diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-09 18:30:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-09 18:31:07 -0500 |
commit | 0d34052dfeba307ebc18d2f672e80e3f419714d4 (patch) | |
tree | 8f7955328cd9700c443c33f88631449a0c1208fb /drivers/base/driver.c | |
parent | f0fb2eb7bd76b9927f1350cfb0a3653385b82c6c (diff) | |
parent | 926beadb3dfaddccb3348a5b9e6c2a1f8290a220 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6:
Revert "driver core: create a private portion of struct device"
Revert "driver core: move klist_children into private structure"
Revert "driver core: move knode_driver into private structure"
Revert "driver core: move knode_bus into private structure"
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 @@ | |||
19 | static struct device *next_device(struct klist_iter *i) | 19 | static struct device *next_device(struct klist_iter *i) |
20 | { | 20 | { |
21 | struct klist_node *n = klist_next(i); | 21 | struct klist_node *n = klist_next(i); |
22 | struct device *dev = NULL; | 22 | return n ? container_of(n, struct device, knode_driver) : NULL; |
23 | struct device_private *dev_prv; | ||
24 | |||
25 | if (n) { | ||
26 | dev_prv = to_device_private_driver(n); | ||
27 | dev = dev_prv->device; | ||
28 | } | ||
29 | return dev; | ||
30 | } | 23 | } |
31 | 24 | ||
32 | /** | 25 | /** |
@@ -49,7 +42,7 @@ int driver_for_each_device(struct device_driver *drv, struct device *start, | |||
49 | return -EINVAL; | 42 | return -EINVAL; |
50 | 43 | ||
51 | klist_iter_init_node(&drv->p->klist_devices, &i, | 44 | klist_iter_init_node(&drv->p->klist_devices, &i, |
52 | start ? &start->p->knode_driver : NULL); | 45 | start ? &start->knode_driver : NULL); |
53 | while ((dev = next_device(&i)) && !error) | 46 | while ((dev = next_device(&i)) && !error) |
54 | error = fn(dev, data); | 47 | error = fn(dev, data); |
55 | klist_iter_exit(&i); | 48 | klist_iter_exit(&i); |
@@ -83,7 +76,7 @@ struct device *driver_find_device(struct device_driver *drv, | |||
83 | return NULL; | 76 | return NULL; |
84 | 77 | ||
85 | klist_iter_init_node(&drv->p->klist_devices, &i, | 78 | klist_iter_init_node(&drv->p->klist_devices, &i, |
86 | (start ? &start->p->knode_driver : NULL)); | 79 | (start ? &start->knode_driver : NULL)); |
87 | while ((dev = next_device(&i))) | 80 | while ((dev = next_device(&i))) |
88 | if (match(dev, data) && get_device(dev)) | 81 | if (match(dev, data) && get_device(dev)) |
89 | break; | 82 | break; |