mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-14 12:37:32 +00:00
[POWERPC] arch/powerpc/kernel: Use for_each_child_of_node
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
parent
e25c47ffa9
commit
85e99b9fff
5 changed files with 8 additions and 11 deletions
|
@ -172,7 +172,7 @@ static int ibmebus_create_devices(const struct of_device_id *matches)
|
||||||
|
|
||||||
root = of_find_node_by_path("/");
|
root = of_find_node_by_path("/");
|
||||||
|
|
||||||
for (child = NULL; (child = of_get_next_child(root, child)); ) {
|
for_each_child_of_node(root, child) {
|
||||||
if (!of_match_node(matches, child))
|
if (!of_match_node(matches, child))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ static int of_platform_bus_create(const struct device_node *bus,
|
||||||
struct of_device *dev;
|
struct of_device *dev;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
for (child = NULL; (child = of_get_next_child(bus, child)); ) {
|
for_each_child_of_node(bus, child) {
|
||||||
pr_debug(" create child: %s\n", child->full_name);
|
pr_debug(" create child: %s\n", child->full_name);
|
||||||
dev = of_platform_device_create(child, NULL, parent);
|
dev = of_platform_device_create(child, NULL, parent);
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
|
@ -171,7 +171,7 @@ int of_platform_bus_probe(struct device_node *root,
|
||||||
rc = of_platform_bus_create(root, matches, &dev->dev);
|
rc = of_platform_bus_create(root, matches, &dev->dev);
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
for (child = NULL; (child = of_get_next_child(root, child)); ) {
|
for_each_child_of_node(root, child) {
|
||||||
if (!of_match_node(matches, child))
|
if (!of_match_node(matches, child))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -276,11 +276,11 @@ scan_OF_pci_childs(struct device_node *parent, pci_OF_scan_iterator filter, void
|
||||||
static struct device_node *scan_OF_for_pci_dev(struct device_node *parent,
|
static struct device_node *scan_OF_for_pci_dev(struct device_node *parent,
|
||||||
unsigned int devfn)
|
unsigned int devfn)
|
||||||
{
|
{
|
||||||
struct device_node *np = NULL;
|
struct device_node *np;
|
||||||
const u32 *reg;
|
const u32 *reg;
|
||||||
unsigned int psize;
|
unsigned int psize;
|
||||||
|
|
||||||
while ((np = of_get_next_child(parent, np)) != NULL) {
|
for_each_child_of_node(parent, np) {
|
||||||
reg = of_get_property(np, "reg", &psize);
|
reg = of_get_property(np, "reg", &psize);
|
||||||
if (reg == NULL || psize < 4)
|
if (reg == NULL || psize < 4)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -227,7 +227,7 @@ EXPORT_SYMBOL(of_create_pci_dev);
|
||||||
void __devinit of_scan_bus(struct device_node *node,
|
void __devinit of_scan_bus(struct device_node *node,
|
||||||
struct pci_bus *bus)
|
struct pci_bus *bus)
|
||||||
{
|
{
|
||||||
struct device_node *child = NULL;
|
struct device_node *child;
|
||||||
const u32 *reg;
|
const u32 *reg;
|
||||||
int reglen, devfn;
|
int reglen, devfn;
|
||||||
struct pci_dev *dev;
|
struct pci_dev *dev;
|
||||||
|
@ -235,7 +235,7 @@ void __devinit of_scan_bus(struct device_node *node,
|
||||||
DBG("of_scan_bus(%s) bus no %d... \n", node->full_name, bus->number);
|
DBG("of_scan_bus(%s) bus no %d... \n", node->full_name, bus->number);
|
||||||
|
|
||||||
/* Scan direct children */
|
/* Scan direct children */
|
||||||
while ((child = of_get_next_child(node, child)) != NULL) {
|
for_each_child_of_node(node, child) {
|
||||||
DBG(" * %s\n", child->full_name);
|
DBG(" * %s\n", child->full_name);
|
||||||
reg = of_get_property(child, "reg", ®len);
|
reg = of_get_property(child, "reg", ®len);
|
||||||
if (reg == NULL || reglen < 20)
|
if (reg == NULL || reglen < 20)
|
||||||
|
|
|
@ -280,10 +280,7 @@ void __init find_and_init_phbs(void)
|
||||||
struct pci_controller *phb;
|
struct pci_controller *phb;
|
||||||
struct device_node *root = of_find_node_by_path("/");
|
struct device_node *root = of_find_node_by_path("/");
|
||||||
|
|
||||||
for (node = of_get_next_child(root, NULL);
|
for_each_child_of_node(root, node) {
|
||||||
node != NULL;
|
|
||||||
node = of_get_next_child(root, node)) {
|
|
||||||
|
|
||||||
if (node->type == NULL || (strcmp(node->type, "pci") != 0 &&
|
if (node->type == NULL || (strcmp(node->type, "pci") != 0 &&
|
||||||
strcmp(node->type, "pciex") != 0))
|
strcmp(node->type, "pciex") != 0))
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue