diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-12-16 12:25:49 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-03-24 16:38:25 -0700 |
commit | 8940b4f312dced51b45004819b776ec3aa7fcd5d (patch) | |
tree | f994df6952a12ad5a3b46762e8a53eaa99f215b6 /drivers/base/driver.c | |
parent | f791b8c836307b58cbf62133a6a772ed1a92fb33 (diff) | |
download | op-kernel-dev-8940b4f312dced51b45004819b776ec3aa7fcd5d.zip op-kernel-dev-8940b4f312dced51b45004819b776ec3aa7fcd5d.tar.gz |
driver core: move knode_driver into private structure
Nothing outside of the driver core should ever touch knode_driver, so
move it out of the public eye.
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/driver.c')
-rw-r--r-- | drivers/base/driver.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 2889ad5..c51f11b 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -19,7 +19,14 @@ static struct device *next_device(struct klist_iter *i) { struct klist_node *n = klist_next(i); - return n ? container_of(n, struct device, knode_driver) : NULL; + struct device *dev = NULL; + struct device_private *dev_prv; + + if (n) { + dev_prv = to_device_private_driver(n); + dev = dev_prv->device; + } + return dev; } /** @@ -42,7 +49,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->knode_driver : NULL); + start ? &start->p->knode_driver : NULL); while ((dev = next_device(&i)) && !error) error = fn(dev, data); klist_iter_exit(&i); @@ -76,7 +83,7 @@ struct device *driver_find_device(struct device_driver *drv, return NULL; klist_iter_init_node(&drv->p->klist_devices, &i, - (start ? &start->knode_driver : NULL)); + (start ? &start->p->knode_driver : NULL)); while ((dev = next_device(&i))) if (match(dev, data) && get_device(dev)) break; |