From: "Luis R. Rodriguez" <mcgrof@xxxxxxxxxxxxxxxx> This backports the following commit: commit ced321bf9151535f85779b0004c93529f860b2a4 Author: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Date: Sun Jul 14 16:05:54 2013 -0700 driver core: device.h: add RW and RO attribute macros Make it easier to create attributes without having to always auditthe mode settings. Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx> Tested-by: Guenter Roeck <linux@xxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxxxxxxxxxx> --- backport/backport-include/linux/device.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h index ba55d0e..13a88ae 100644 --- a/backport/backport-include/linux/device.h +++ b/backport/backport-include/linux/device.h @@ -195,4 +195,27 @@ extern int dev_set_name(struct device *dev, const char *name, ...) }) #endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(3,6,0) */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0) +#define BUS_ATTR_RW(_name) \ + struct bus_attribute bus_attr_##_name = __ATTR_RW(_name) +#define BUS_ATTR_RO(_name) \ + struct bus_attribute bus_attr_##_name = __ATTR_RO(_name) + +#define DRIVER_ATTR_RW(_name) \ + struct driver_attribute driver_attr_##_name = __ATTR_RW(_name) +#define DRIVER_ATTR_RO(_name) \ + struct driver_attribute driver_attr_##_name = __ATTR_RO(_name) + +#define CLASS_ATTR_RW(_name) \ + struct class_attribute class_attr_##_name = __ATTR_RW(_name) +#define CLASS_ATTR_RO(_name) \ + struct class_attribute class_attr_##_name = __ATTR_RO(_name) + +#define DEVICE_ATTR_RW(_name) \ + struct device_attribute dev_attr_##_name = __ATTR_RW(_name) +#define DEVICE_ATTR_RO(_name) \ + struct device_attribute dev_attr_##_name = __ATTR_RO(_name) + +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0) */ + #endif /* __BACKPORT_DEVICE_H */ -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe backports" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html