[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1373486714-14531-5-git-send-email-gregkh@linuxfoundation.org>
Date: Wed, 10 Jul 2013 13:05:12 -0700
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: oliver+list@...inagl.nl, linux@...ck-us.net, khali@...ux-fr.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: [PATCH 4/6] driver core: add DEVICE_ATTR_RW and DEVICE_ATTR_RO macros
Make it easier to create attributes without having to always audit the
mode settings.
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
include/linux/device.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/linux/device.h b/include/linux/device.h
index bcf8c0d..1d546a0 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -512,6 +512,10 @@ ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
#define DEVICE_ATTR(_name, _mode, _show, _store) \
struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
+#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)
#define DEVICE_ULONG_ATTR(_name, _mode, _var) \
struct dev_ext_attribute dev_attr_##_name = \
{ __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) }
--
1.8.3.rc0.20.gb99dd2e
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists