summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPatrick Mochel <mochel@osdl.org>2002-10-16 02:24:19 -0700
committerPatrick Mochel <mochel@osdl.org>2002-10-16 02:24:19 -0700
commit0447d4d59e85bb0c177fcc858a4fef8671a6cf04 (patch)
tree3f0f0d336635672d3d55396d844d3e09eccd8499 /include
parent9af95a1093ae2ae41813ec5f2ca092dc9749af04 (diff)
parentba809e8ac59030f8b8c1822f0ce6b3161cabc60b (diff)
Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin
into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-core
Diffstat (limited to 'include')
-rw-r--r--include/linux/device.h29
-rw-r--r--include/linux/driverfs_fs.h2
2 files changed, 13 insertions, 18 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 80a63939f924..c0f8d6c5e4bf 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -54,8 +54,9 @@ struct device_class;
struct bus_type {
char * name;
- rwlock_t lock;
+ struct rw_semaphore rwsem;
atomic_t refcount;
+ u32 present;
struct list_head node;
struct list_head devices;
@@ -73,14 +74,9 @@ struct bus_type {
extern int bus_register(struct bus_type * bus);
+extern void bus_unregister(struct bus_type * bus);
-static inline struct bus_type * get_bus(struct bus_type * bus)
-{
- BUG_ON(!atomic_read(&bus->refcount));
- atomic_inc(&bus->refcount);
- return bus;
-}
-
+extern 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,
@@ -114,6 +110,7 @@ struct device_driver {
rwlock_t lock;
atomic_t refcount;
+ u32 present;
struct list_head bus_list;
struct list_head class_list;
@@ -131,16 +128,10 @@ struct device_driver {
};
-
extern int driver_register(struct device_driver * drv);
+extern void driver_unregister(struct device_driver * drv);
-static inline struct device_driver * get_driver(struct device_driver * drv)
-{
- BUG_ON(!atomic_read(&drv->refcount));
- atomic_inc(&drv->refcount);
- return drv;
-}
-
+extern struct device_driver * get_driver(struct device_driver * drv);
extern void put_driver(struct device_driver * drv);
extern void remove_driver(struct device_driver * drv);
@@ -172,6 +163,9 @@ extern void driver_remove_file(struct device_driver *, struct driver_attribute *
*/
struct device_class {
char * name;
+ atomic_t refcount;
+ u32 present;
+
u32 devnum;
struct list_head node;
@@ -189,6 +183,9 @@ struct device_class {
extern int devclass_register(struct device_class *);
extern void devclass_unregister(struct device_class *);
+extern struct device_class * get_devclass(struct device_class *);
+extern void put_devclass(struct device_class *);
+
struct devclass_attribute {
struct attribute attr;
diff --git a/include/linux/driverfs_fs.h b/include/linux/driverfs_fs.h
index d859f8c2e041..b4270e947a1e 100644
--- a/include/linux/driverfs_fs.h
+++ b/include/linux/driverfs_fs.h
@@ -65,6 +65,4 @@ driverfs_create_symlink(struct driver_dir_entry * parent,
extern void
driverfs_remove_file(struct driver_dir_entry *, const char * name);
-extern int init_driverfs_fs(void);
-
#endif /* _DDFS_H_ */