driver core: add BUS_ATTR_WO() macro
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Jul 2018 13:20:32 +0000 (15:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Oct 2018 10:47:28 +0000 (12:47 +0200)
Many bus attributes are write-only, so provide a simple macro for that
to be able to match the other driver core attribute macros.

Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/device.h

index 8f88254..767cf19 100644 (file)
@@ -55,6 +55,8 @@ struct bus_attribute {
        struct bus_attribute bus_attr_##_name = __ATTR_RW(_name)
 #define BUS_ATTR_RO(_name) \
        struct bus_attribute bus_attr_##_name = __ATTR_RO(_name)
+#define BUS_ATTR_WO(_name) \
+       struct bus_attribute bus_attr_##_name = __ATTR_WO(_name)
 
 extern int __must_check bus_create_file(struct bus_type *,
                                        struct bus_attribute *);