backports: Avoid multiple definition of DEVICE_ATTR_RW for older kernels
authorJonathan DE CESCO <jonathan.de.cesco@intel.com>
Mon, 26 May 2014 14:15:36 +0000 (17:15 +0300)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 1 Jun 2014 22:16:15 +0000 (00:16 +0200)
This definition may exists on non-vanilla kernels.

Signed-off-by: Jonathan DE CESCO <jonathan.de.cesco@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
backport/backport-include/linux/device.h

index 3403896db12ce024f0ca6d61c1041aeabea8e95c..e574d4739bbc98d093a707b725a6b9f4166d18be 100644 (file)
@@ -107,9 +107,11 @@ backport_device_release_driver(struct device *dev)
 #define DEVICE_ATTR_RO(_name) \
 struct device_attribute dev_attr_ ## _name = __ATTR_RO(_name);
 #endif
+#ifndef DEVICE_ATTR_RW
 #define DEVICE_ATTR_RW(_name) \
 struct device_attribute dev_attr_ ## _name = __ATTR_RW(_name)
 #endif
+#endif
 
 #define ATTRIBUTE_GROUPS_BACKPORT(_name) \
 static struct BP_ATTR_GRP_STRUCT _name##_dev_attrs[ARRAY_SIZE(_name##_attrs)];\