summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/device.h20
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 */