Skip to content

Commit

Permalink
[PATCH] Use device_for_each_child() to unregister devices in nodemgr_…
Browse files Browse the repository at this point in the history
…remove_host_dev()

Signed-off-by: Greg Kroah-Hartman <[email protected]>

diff -Nru a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
  • Loading branch information
gregkh committed Jun 20, 2005
1 parent ff71071 commit 6436032
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/ieee1394/nodemgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 6436032

Please sign in to comment.