2 * Copyright 2010 Michael Ellerman, IBM Corporation
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
10 #include <linux/kernel.h>
11 #include <linux/of_platform.h>
16 * Find chip-id by walking up device tree looking for ibm,wsp-chip-id property.
17 * Won't work for nodes that are not a descendant of a wsp node.
19 int wsp_get_chip_id(struct device_node
*dn
)
24 /* Start looking at the specified node, not its parent */
26 while (dn
&& !(p
= of_get_property(dn
, "ibm,wsp-chip-id", NULL
)))
27 dn
= of_get_next_parent(dn
);