From: gregkh@suse.de Date: Fri, 25 Mar 2005 19:45:31 +0000 (-0800) Subject: [PATCH] Use device_for_each_child() to unregister devices in nodemgr_remove_host_dev() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=64360322ab3330d4881166380ad43a1eec2f123d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [PATCH] Use device_for_each_child() to unregister devices in nodemgr_remove_host_dev() Signed-off-by: Greg Kroah-Hartman diff -Nru a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c --- diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index 83e66ed97ab5..a155b39469a1 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c @@ -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");