diff mbox

backports: add CLASS_ATTR_RW/CLASS_ATTR_RO

Message ID 20170206132126.20944-1-johannes@sipsolutions.net (mailing list archive)
State Accepted
Headers show

Commit Message

Johannes Berg Feb. 6, 2017, 1:21 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

Change-Id: Ibe8e98992349c8ddeea2155a8dff5e281a7672b9
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/device.h | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox

Patch

diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h
index 079b00d391c4..cc84738329a7 100644
--- a/backport/backport-include/linux/device.h
+++ b/backport/backport-include/linux/device.h
@@ -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)				\