backports: device: don't redefine DEVICE_ATTR_RO
authorArik Nemtsov <arik@wizery.com>
Wed, 9 Apr 2014 12:04:13 +0000 (15:04 +0300)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Thu, 17 Apr 2014 23:23:08 +0000 (16:23 -0700)
Some old custom kernels have it defined.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
backport/backport-include/linux/device.h

index ebfc01a5b49e4a26b879eabe70ed7a557737ecf8..a54756a49ff27197b58b7228a0d0c1be6d42a010 100644 (file)
@@ -193,8 +193,10 @@ backport_device_release_driver(struct device *dev)
 #endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(3,6,0) */
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
+#ifndef DEVICE_ATTR_RO
 #define DEVICE_ATTR_RO(_name) \
 struct device_attribute dev_attr_ ## _name = __ATTR_RO(_name);
+#endif
 #define DEVICE_ATTR_RW(_name) \
 struct device_attribute dev_attr_ ## _name = __ATTR_RW(_name)
 #endif