* [PATCH 2.6.12-rc4] include/linux:(dynamic sysfs callbacks) new attribute macros
@ 2005-05-14 9:38 Yani Ioannou
0 siblings, 0 replies; only message in thread
From: Yani Ioannou @ 2005-05-14 9:38 UTC (permalink / raw)
To: Greg KH, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 341 bytes --]
Hi,
The following patch adds a new __ATTR_PRIVATE macro and a
DEVICE_ATTR_PRIVATE macro to be used when creating static device
attributes with a void * member.
Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com>
Thanks,
Yani
---
device.h | 3 +++
sysfs.h | 11 +++++++++++
2 files changed, 14 insertions(+)
---
[-- Attachment #2: patch-linux-2.6.12-rc4-sysfsdyncallback-deviceattr-macro.diff --]
[-- Type: text/x-patch, Size: 1711 bytes --]
diff -uprN -X dontdiff linux-2.6.12-rc4-sysfsdyncallback-deviceattr/include/linux/device.h linux-2.6.12-rc4-sysfsdyncallback-deviceattr-macro/include/linux/device.h
--- linux-2.6.12-rc4-sysfsdyncallback-deviceattr/include/linux/device.h 2005-05-13 01:02:10.000000000 -0400
+++ linux-2.6.12-rc4-sysfsdyncallback-deviceattr-macro/include/linux/device.h 2005-05-13 01:09:27.000000000 -0400
@@ -343,6 +343,9 @@ struct device_attribute {
#define DEVICE_ATTR(_name,_mode,_show,_store) \
struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store)
+#define DEVICE_ATTR_PRIVATE(_name,_mode,_show,_store,_private) \
+struct device_attribute dev_attr_##_name = \
+ __ATTR_PRIVATE(_name,_mode,_show,_store,_private)
extern int device_create_file(struct device *device, struct device_attribute * entry);
extern void device_remove_file(struct device * dev, struct device_attribute * attr);
diff -uprN -X dontdiff linux-2.6.12-rc4-sysfsdyncallback-deviceattr/include/linux/sysfs.h linux-2.6.12-rc4-sysfsdyncallback-deviceattr-macro/include/linux/sysfs.h
--- linux-2.6.12-rc4-sysfsdyncallback-deviceattr/include/linux/sysfs.h 2005-05-13 01:02:10.000000000 -0400
+++ linux-2.6.12-rc4-sysfsdyncallback-deviceattr-macro/include/linux/sysfs.h 2005-05-13 01:08:09.000000000 -0400
@@ -45,6 +45,17 @@ struct attribute_group {
.store = _store, \
}
+#define __ATTR_PRIVATE(_name,_mode,_show,_store,_private) { \
+ .attr = { \
+ .name = __stringify(_name), \
+ .mode = _mode, \
+ .private = _private, \
+ .owner = THIS_MODULE, \
+ }, \
+ .show = _show, \
+ .store = _store, \
+}
+
#define __ATTR_RO(_name) { \
.attr = { \
.name = __stringify(_name), \
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-05-14 10:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-14 9:38 [PATCH 2.6.12-rc4] include/linux:(dynamic sysfs callbacks) new attribute macros Yani Ioannou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox