Commit 64360322 authored by gregkh@suse.de's avatar gregkh@suse.de Committed by Greg Kroah-Hartman

[PATCH] Use device_for_each_child() to unregister devices in nodemgr_remove_host_dev()

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>

diff -Nru a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
parent ff710710
...@@ -695,14 +695,15 @@ static void nodemgr_remove_ne(struct node_entry *ne) ...@@ -695,14 +695,15 @@ static void nodemgr_remove_ne(struct node_entry *ne)
put_device(dev); 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) static void nodemgr_remove_host_dev(struct device *dev)
{ {
struct device *ne_dev, *next; device_for_each_child(dev, NULL, __nodemgr_remove_host_dev);
list_for_each_entry_safe(ne_dev, next, &dev->children, node)
nodemgr_remove_ne(container_of(ne_dev, struct node_entry, device));
sysfs_remove_link(&dev->kobj, "irm_id"); sysfs_remove_link(&dev->kobj, "irm_id");
sysfs_remove_link(&dev->kobj, "busmgr_id"); sysfs_remove_link(&dev->kobj, "busmgr_id");
sysfs_remove_link(&dev->kobj, "host_id"); sysfs_remove_link(&dev->kobj, "host_id");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment