diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-19 22:17:30 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-19 22:17:30 -0400 |
commit | 7cd9c9bb57476167e83b7780dbc06d1dd601789d (patch) | |
tree | afcf43a6d5e4661306676ebcd08224906170b578 /drivers/base/driver.c | |
parent | 591bfc6bf9e5e25e464fd4c87d64afd5135667c4 (diff) |
Revert "driver core: check start node in klist_iter_init_node"
This reverts commit a15d49fd3094cff90e5410ca454a870e0a722fe1 as that
patch broke the build.
Cc: Hannes Reinecke <hare@suse.de>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/driver.c')
-rw-r--r-- | drivers/base/driver.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 16f6dd2c4403..3ec3896c83a6 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c | |||
@@ -49,13 +49,11 @@ int driver_for_each_device(struct device_driver *drv, struct device *start, | |||
49 | if (!drv) | 49 | if (!drv) |
50 | return -EINVAL; | 50 | return -EINVAL; |
51 | 51 | ||
52 | error = klist_iter_init_node(&drv->p->klist_devices, &i, | 52 | klist_iter_init_node(&drv->p->klist_devices, &i, |
53 | start ? &start->p->knode_driver : NULL); | 53 | start ? &start->p->knode_driver : NULL); |
54 | if (!error) { | 54 | while ((dev = next_device(&i)) && !error) |
55 | while ((dev = next_device(&i)) && !error) | 55 | error = fn(dev, data); |
56 | error = fn(dev, data); | 56 | klist_iter_exit(&i); |
57 | klist_iter_exit(&i); | ||
58 | } | ||
59 | return error; | 57 | return error; |
60 | } | 58 | } |
61 | EXPORT_SYMBOL_GPL(driver_for_each_device); | 59 | EXPORT_SYMBOL_GPL(driver_for_each_device); |
@@ -85,10 +83,8 @@ struct device *driver_find_device(struct device_driver *drv, | |||
85 | if (!drv) | 83 | if (!drv) |
86 | return NULL; | 84 | return NULL; |
87 | 85 | ||
88 | if (klist_iter_init_node(&drv->p->klist_devices, &i, | 86 | klist_iter_init_node(&drv->p->klist_devices, &i, |
89 | (start ? &start->p->knode_driver : NULL)) < 0) | 87 | (start ? &start->p->knode_driver : NULL)); |
90 | return NULL; | ||
91 | |||
92 | while ((dev = next_device(&i))) | 88 | while ((dev = next_device(&i))) |
93 | if (match(dev, data) && get_device(dev)) | 89 | if (match(dev, data) && get_device(dev)) |
94 | break; | 90 | break; |