Index: arch/parisc/kernel/drivers.c =================================================================== RCS file: /var/cvs/linux-2.6/arch/parisc/kernel/drivers.c,v retrieving revision 1.25 diff -u -r1.25 drivers.c --- arch/parisc/kernel/drivers.c 26 Jul 2005 23:55:47 -0000 1.25 +++ arch/parisc/kernel/drivers.c 1 Aug 2005 14:45:26 -0000 @@ -59,19 +59,11 @@ static int descend_children(struct device * dev, void * data) { struct recurse_struct * recurse_data = (struct recurse_struct *)data; - int ret; - /* - * First, descend down the tree. - */ - ret = device_for_each_child(dev, recurse_data, descend_children); - if (ret) - return ret; - - /* - * Now, iterate over the children and call the function. - */ - return device_for_each_child(dev, recurse_data->obj, recurse_data->fn); + if (recurse_data->fn(dev, recurse_data->obj)) + return 1; + else + return device_for_each_child(dev, recurse_data, descend_children); } /** @@ -80,7 +72,8 @@ * @data: Data to pass to the called function. * * This performs a depth-first traversal of the tree, calling the - * function passed for each node. + * function passed for each node. It calls the function for parents + * before children. */ static int for_each_padev(int (*fn)(struct device *, void *), void * data) @@ -89,7 +82,7 @@ .obj = data, .fn = fn, }; - return descend_children(&root, &recurse_data); + return device_for_each_child(&root, &recurse_data, descend_children); } /** @@ -448,11 +441,9 @@ struct parisc_device * pdev = to_parisc_device(dev); struct match_id_data * d = data; - if (check_dev(pdev)) { - if (pdev->hw_path == d->id) { - d->dev = pdev; - return 1; - } + if (pdev->hw_path == d->id) { + d->dev = pdev; + return 1; } return 0; }