]> Pileus Git - ~andy/linux/commitdiff
driver core: create write-only attribute macros for devices and drivers
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Aug 2013 22:02:56 +0000 (15:02 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Aug 2013 22:02:56 +0000 (15:02 -0700)
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>
include/linux/device.h

index 26e23b22ed0a20a45ecb4e4eef0711a5d5e6b7bf..0ed94b5f67fc5b12d7279e14064c3b76e47d0ff1 100644 (file)
@@ -277,6 +277,8 @@ struct driver_attribute {
        struct driver_attribute driver_attr_##_name = __ATTR_RW(_name)
 #define DRIVER_ATTR_RO(_name) \
        struct driver_attribute driver_attr_##_name = __ATTR_RO(_name)
+#define DRIVER_ATTR_WO(_name) \
+       struct driver_attribute driver_attr_##_name = __ATTR_WO(_name)
 
 extern int __must_check driver_create_file(struct device_driver *driver,
                                        const struct driver_attribute *attr);
@@ -534,6 +536,8 @@ ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
        struct device_attribute dev_attr_##_name = __ATTR_RW(_name)
 #define DEVICE_ATTR_RO(_name) \
        struct device_attribute dev_attr_##_name = __ATTR_RO(_name)
+#define DEVICE_ATTR_WO(_name) \
+       struct device_attribute dev_attr_##_name = __ATTR_WO(_name)
 #define DEVICE_ULONG_ATTR(_name, _mode, _var) \
        struct dev_ext_attribute dev_attr_##_name = \
                { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) }