summaryrefslogtreecommitdiff
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorPatrick Mochel <mochel@osdl.org>2002-05-28 19:51:08 -0700
committerPatrick Mochel <mochel@osdl.org>2002-05-28 19:51:08 -0700
commite1e5aa9b53be641a87ed3cb98871bb0abdf3e4f2 (patch)
tree54c2df2680ee17f1f88bf1f93e4bee8af7f63bf1 /include/linux/device.h
parent21a16f65b95259e28e99eb81977c790e77133ffb (diff)
Device Model: Add helpers bus_for_each_dev and bus_for_each_drv
- iterators for accessing bus's lists of devices and drivers - does locking on bus for each list access - does reference counting on objects as it grabs and releases them - calls callback for each object in list
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 2ad1e9ff4f75..b8729d952190 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -54,7 +54,7 @@ enum {
};
struct device;
-
+struct device_driver;
struct bus_type {
char * name;
@@ -82,6 +82,11 @@ static inline struct bus_type * get_bus(struct bus_type * bus)
extern void put_bus(struct bus_type * bus);
+extern int bus_for_each_dev(struct bus_type * bus, void * data,
+ int (*callback)(struct device * dev, void * data));
+extern int bus_for_each_drv(struct bus_type * bus, void * data,
+ int (*callback)(struct device_driver * drv, void * data));
+
struct device_driver {
char * name;