]> git.karo-electronics.de Git - linux-beck.git/commitdiff
driver core: add CLASS_ATTR_WO()
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Nov 2016 17:31:49 +0000 (18:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Nov 2016 15:08:13 +0000 (16:08 +0100)
Some class subsystems are open-coding CLASS_ATTR_WO because the driver
core never provided it.  Add the macro to device.h so that we can go
around and fix up the individual subsystems as needed.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/device.h

index 49f453892ca55c021741e956af6dcd810c3c21d5..4264caacebb9450b7e6d5ddffa6b5e42f8ecd040 100644 (file)
@@ -465,6 +465,8 @@ struct class_attribute {
        struct class_attribute class_attr_##_name = __ATTR_RW(_name)
 #define CLASS_ATTR_RO(_name) \
        struct class_attribute class_attr_##_name = __ATTR_RO(_name)
+#define CLASS_ATTR_WO(_name) \
+       struct class_attribute class_attr_##_name = __ATTR_WO(_name)
 
 extern int __must_check class_create_file_ns(struct class *class,
                                             const struct class_attribute *attr,