]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] Use device_for_each_child() to unregister devices in nodemgr_remove_host_dev()
authorgregkh@suse.de <gregkh@suse.de>
Fri, 25 Mar 2005 19:45:31 +0000 (11:45 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Jun 2005 22:15:26 +0000 (15:15 -0700)
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
diff -Nru a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c

drivers/ieee1394/nodemgr.c

index 83e66ed97ab53640480728c816b810e7c67319a5..a155b39469a13b22ed6a2e9db7d9eb1fc627f6b8 100644 (file)
@@ -695,14 +695,15 @@ static void nodemgr_remove_ne(struct node_entry *ne)
        put_device(dev);
 }
 
+static int __nodemgr_remove_host_dev(struct device *dev, void *data)
+{
+       nodemgr_remove_ne(container_of(dev, struct node_entry, device));
+       return 0;
+}
 
 static void nodemgr_remove_host_dev(struct device *dev)
 {
-       struct device *ne_dev, *next;
-
-       list_for_each_entry_safe(ne_dev, next, &dev->children, node)
-               nodemgr_remove_ne(container_of(ne_dev, struct node_entry, device));
-
+       device_for_each_child(dev, NULL, __nodemgr_remove_host_dev);
        sysfs_remove_link(&dev->kobj, "irm_id");
        sysfs_remove_link(&dev->kobj, "busmgr_id");
        sysfs_remove_link(&dev->kobj, "host_id");