Skip to contentSkip to conversation

backports: add CLASS_ATTR_RW/CLASS_ATTR_RO

PATCH New Johannes Berg 1 participant 1 message Feb 6, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 backports: add CLASS_ATTR_RW/CLASS_ATTR_RO

From: Johannes Berg <[email protected]>

Change-Id Ibe8e98992349c8ddeea2155a8dff5e281a7672b9
---
 backport/backport-include/linux/device.h | 9 +++++++++
 1 file changed, 9 insertions(+)
backport/backport-include/linux/device.h +9 -0
index 079b00d391c4..cc84738329a7 100644
@@ -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