diff options
author | gregkh@suse.de <gregkh@suse.de> | 2005-03-25 14:45:31 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-20 18:15:26 -0400 |
commit | 64360322ab3330d4881166380ad43a1eec2f123d (patch) | |
tree | cfb876990acbe4669e9ba45d6252c75538288f24 /drivers/ieee1394/nodemgr.c | |
parent | ff710710eae73990dd484ea8e37dba636452502b (diff) |
[PATCH] Use device_for_each_child() to unregister devices in nodemgr_remove_host_dev()
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
diff -Nru a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
Diffstat (limited to 'drivers/ieee1394/nodemgr.c')
-rw-r--r-- | drivers/ieee1394/nodemgr.c | 11 |
1 files changed, 6 insertions, 5 deletions
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) | |||
695 | put_device(dev); | 695 | put_device(dev); |
696 | } | 696 | } |
697 | 697 | ||
698 | static int __nodemgr_remove_host_dev(struct device *dev, void *data) | ||
699 | { | ||
700 | nodemgr_remove_ne(container_of(dev, struct node_entry, device)); | ||
701 | return 0; | ||
702 | } | ||
698 | 703 | ||
699 | static void nodemgr_remove_host_dev(struct device *dev) | 704 | static void nodemgr_remove_host_dev(struct device *dev) |
700 | { | 705 | { |
701 | struct device *ne_dev, *next; | 706 | device_for_each_child(dev, NULL, __nodemgr_remove_host_dev); |
702 | |||
703 | list_for_each_entry_safe(ne_dev, next, &dev->children, node) | ||
704 | nodemgr_remove_ne(container_of(ne_dev, struct node_entry, device)); | ||
705 | |||
706 | sysfs_remove_link(&dev->kobj, "irm_id"); | 707 | sysfs_remove_link(&dev->kobj, "irm_id"); |
707 | sysfs_remove_link(&dev->kobj, "busmgr_id"); | 708 | sysfs_remove_link(&dev->kobj, "busmgr_id"); |
708 | sysfs_remove_link(&dev->kobj, "host_id"); | 709 | sysfs_remove_link(&dev->kobj, "host_id"); |