diff options
| author | Patrick Mochel <mochel@osdl.org> | 2002-12-01 11:22:05 -0600 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2002-12-01 11:22:05 -0600 |
| commit | fc8aae5360008cf232c5f5bdc65b772a73a248c2 (patch) | |
| tree | ab799d6f76a95ac0e2a0a88dda05da3086eba2f1 /include/linux/device.h | |
| parent | 93186e2388e34c792afb4a09c6d99768d0d0dd94 (diff) | |
driver model: reinstate bus iterators.
This replaces the bus iterators bus_for_each_dev() and bus_for_each_drv().
Though no one in the kernel was using these, the MCA bus updates that are
about to appear depend on them.
They both now take a start pointer, which is the item to begin walking
the list from, if it is not NULL.
Diffstat (limited to 'include/linux/device.h')
| -rw-r--r-- | include/linux/device.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 9835d4fcdb12..435159cb14b8 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -85,6 +85,15 @@ extern struct bus_type * get_bus(struct bus_type * bus); extern void put_bus(struct bus_type * bus); +/* iterator helpers for buses */ + +int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, + int (*fn)(struct device *, void *)); + +int bus_for_each_drv(struct bus_type * bus, struct device_driver * start, + void * data, int (*fn)(struct device_driver *, void *)); + + /* driverfs interface for exporting bus attributes */ struct bus_attribute { |
