diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2002-08-13 05:03:34 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-08-13 05:03:34 -0700 |
| commit | 76044a7fb6edda7a0cdf3acc9318376d1d89faa5 (patch) | |
| tree | 42c2c9cefd4e86b44a2c6c09ef2e99b4c70161ef /include | |
| parent | d001e08a4a06bdc79e31750f26368ba1753fbbe0 (diff) | |
| parent | 4446b906c3dfb27413889d9fc852fda6b16dea38 (diff) | |
Merge bk://ldm.bkbits.net/linux-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'include')
| -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 */ |
