diff options
author | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2009-01-14 16:29:51 +1100 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2009-01-14 16:29:51 +1100 |
commit | cb7a97d01521797cad9f63e8478403c3e51fea49 (patch) | |
tree | 84cddf20369f82f10c1c3712e6cce20dd1b9d863 /drivers/base/driver.c | |
parent | 0335cb76aa3fa913a2164bc9b669e5aef9d56fa3 (diff) | |
parent | a6525042bfdfcab128bd91fad264de10fd24a55e (diff) | |
download | linux-cb7a97d01521797cad9f63e8478403c3e51fea49.tar.bz2 |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
Diffstat (limited to 'drivers/base/driver.c')
-rw-r--r-- | drivers/base/driver.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/base/driver.c b/drivers/base/driver.c index b76cc69f1106..1e2bda780e48 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -19,14 +19,7 @@ static struct device *next_device(struct klist_iter *i) { struct klist_node *n = klist_next(i); - struct device *dev = NULL; - struct device_private *dev_prv; - - if (n) { - dev_prv = to_device_private_driver(n); - dev = dev_prv->device; - } - return dev; + return n ? container_of(n, struct device, knode_driver) : NULL; } /** @@ -49,7 +42,7 @@ int driver_for_each_device(struct device_driver *drv, struct device *start, return -EINVAL; klist_iter_init_node(&drv->p->klist_devices, &i, - start ? &start->p->knode_driver : NULL); + start ? &start->knode_driver : NULL); while ((dev = next_device(&i)) && !error) error = fn(dev, data); klist_iter_exit(&i); @@ -83,7 +76,7 @@ struct device *driver_find_device(struct device_driver *drv, return NULL; klist_iter_init_node(&drv->p->klist_devices, &i, - (start ? &start->p->knode_driver : NULL)); + (start ? &start->knode_driver : NULL)); while ((dev = next_device(&i))) if (match(dev, data) && get_device(dev)) break; |