aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-23 18:02:56 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-23 18:02:56 -0400
commit1130c55c757660ac83bd2de220f08580c56b6855 (patch)
tree97cec72dc80737c0306d84df9c62d80f0d419d35 /include/linux/device.h
parenta65fcce75a75c0d41b938f86d09d42b6f1733309 (diff)
driver core: create write-only attribute macros for devices and drivers
This creates the macros DRIVER_ATTR_WO() and DEVICE_ATTR_WO() for write-only attributes for drivers and devices. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 26e23b22ed0a..0ed94b5f67fc 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -277,6 +277,8 @@ struct driver_attribute {
277 struct driver_attribute driver_attr_##_name = __ATTR_RW(_name) 277 struct driver_attribute driver_attr_##_name = __ATTR_RW(_name)
278#define DRIVER_ATTR_RO(_name) \ 278#define DRIVER_ATTR_RO(_name) \
279 struct driver_attribute driver_attr_##_name = __ATTR_RO(_name) 279 struct driver_attribute driver_attr_##_name = __ATTR_RO(_name)
280#define DRIVER_ATTR_WO(_name) \
281 struct driver_attribute driver_attr_##_name = __ATTR_WO(_name)
280 282
281extern int __must_check driver_create_file(struct device_driver *driver, 283extern int __must_check driver_create_file(struct device_driver *driver,
282 const struct driver_attribute *attr); 284 const struct driver_attribute *attr);
@@ -534,6 +536,8 @@ ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
534 struct device_attribute dev_attr_##_name = __ATTR_RW(_name) 536 struct device_attribute dev_attr_##_name = __ATTR_RW(_name)
535#define DEVICE_ATTR_RO(_name) \ 537#define DEVICE_ATTR_RO(_name) \
536 struct device_attribute dev_attr_##_name = __ATTR_RO(_name) 538 struct device_attribute dev_attr_##_name = __ATTR_RO(_name)
539#define DEVICE_ATTR_WO(_name) \
540 struct device_attribute dev_attr_##_name = __ATTR_WO(_name)
537#define DEVICE_ULONG_ATTR(_name, _mode, _var) \ 541#define DEVICE_ULONG_ATTR(_name, _mode, _var) \
538 struct dev_ext_attribute dev_attr_##_name = \ 542 struct dev_ext_attribute dev_attr_##_name = \
539 { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) } 543 { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) }