diff options
| author | Patrick Mochel <mochel@osdl.org> | 2002-08-13 00:15:44 -0700 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2002-08-13 00:15:44 -0700 |
| commit | 8137f0c95fe0d54f402aebfb9750a0d610f55048 (patch) | |
| tree | 7417ad89ee05be540b1504d2264320c8b95eea71 /include/linux | |
| parent | 322bdbf706ac632cc1eb48cd247e752281a0cd99 (diff) | |
| parent | 789e39b03171d02308ba0f2f86711a1721595639 (diff) | |
Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin
into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-driverfs-test
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/device.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 9706d94ff7b6..c33eae266026 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -93,9 +93,9 @@ struct bus_attribute { ssize_t (*store)(struct bus_type *, const char * buf, size_t count, loff_t off); }; -#define BUS_ATTR(_name,_str,_mode,_show,_store) \ +#define BUS_ATTR(_name,_mode,_show,_store) \ struct bus_attribute bus_attr_##_name = { \ - .attr = {.name = _str, .mode = _mode }, \ + .attr = {.name = __stringify(_name), .mode = _mode }, \ .show = _show, \ .store = _store, \ }; @@ -150,9 +150,9 @@ struct driver_attribute { ssize_t (*store)(struct device_driver *, const char * buf, size_t count, loff_t off); }; -#define DRIVER_ATTR(_name,_str,_mode,_show,_store) \ +#define DRIVER_ATTR(_name,_mode,_show,_store) \ struct driver_attribute driver_attr_##_name = { \ - .attr = {.name = _str, .mode = _mode }, \ + .attr = {.name = __stringify(_name), .mode = _mode }, \ .show = _show, \ .store = _store, \ }; @@ -222,13 +222,14 @@ struct device_attribute { ssize_t (*store)(struct device * dev, const char * buf, size_t count, loff_t off); }; -#define DEVICE_ATTR(_name,_str,_mode,_show,_store) \ +#define DEVICE_ATTR(_name,_mode,_show,_store) \ struct device_attribute dev_attr_##_name = { \ - .attr = {.name = _str, .mode = _mode }, \ + .attr = {.name = __stringify(_name), .mode = _mode }, \ .show = _show, \ .store = _store, \ }; + extern int device_create_file(struct device *device, struct device_attribute * entry); extern void device_remove_file(struct device * dev, struct device_attribute * attr); @@ -260,12 +261,7 @@ static inline void unlock_device(struct device * dev) * get_device - atomically increment the reference count for the device. * */ -static inline void get_device(struct device * dev) -{ - BUG_ON(!atomic_read(&dev->refcount)); - atomic_inc(&dev->refcount); -} - +extern struct device * get_device(struct device * dev); extern void put_device(struct device * dev); /* drivers/base/sys.c */ |
