From: Greg Kroah-Hartman Date: Wed, 11 Jul 2018 13:20:32 +0000 (+0200) Subject: driver core: add BUS_ATTR_WO() macro X-Git-Tag: v4.20-rc1~108^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8514c470dc18e58f27dee10a787175ef8f31162f;p=thirdparty%2Fkernel%2Flinux.git driver core: add BUS_ATTR_WO() macro 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" Cc: Ioana Ciornei Signed-off-by: Greg Kroah-Hartman --- diff --git a/include/linux/device.h b/include/linux/device.h index 8f882549edeec..767cf1938b14d 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -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 *);