backports: add CLASS_ATTR_RW/CLASS_ATTR_RO
PATCH 1/1 backports: add CLASS_ATTR_RW/CLASS_ATTR_RO
From: Johannes Berg <[email protected]>
Change-Id Ibe8e98992349c8ddeea2155a8dff5e281a7672b9
Signed-off-by Johannes Berg <[email protected]>
--- backport/backport-include/linux/device.h | 9 +++++++++ 1 file changed, 9 insertions(+)
backport/backport-include/linux/device.h +9 -0
@@ -136,6 +136,15 @@ struct device_attribute dev_attr_ ## _name = __ATTR_RW(_name)#endif #endif +#ifndef CLASS_ATTR_RW +#define CLASS_ATTR_RW (_name) \ + struct class_attribute class_attr_##_name = __ATTR_RW(_name) +#endif +#ifndef CLASS_ATTR_RO +#define CLASS_ATTR_RO (_name) \ + struct class_attribute class_attr_##_name = __ATTR_RO(_name) +#endif +#define ATTRIBUTE_GROUPS_BACKPORT (_name) \ static struct BP_ATTR_GRP_STRUCT _name##_dev_attrs[ARRAY_SIZE(_name##_attrs)];\ static void init_##_name##_attrs(void) \
Signature · 4 lines
2.9.3 -- To unsubscribe from this list: send the line "unsubscribe backports" in