[PATCH] [2/3] sysfs: Add utility macros for declaring generic extended sysdev attributes
From: Andi Kleen
Date: Tue Sep 02 2008 - 07:26:55 EST
This is similar to _SYSDEV_ULONG_ATTR, but allows to use
Needed for followup patch.
Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
---
include/linux/sysdev.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Index: linux/include/linux/sysdev.h
===================================================================
--- linux.orig/include/linux/sysdev.h
+++ linux/include/linux/sysdev.h
@@ -139,7 +139,12 @@ extern ssize_t sysdev_show_int(struct sy
char *);
extern ssize_t sysdev_store_int(struct sys_device *,
struct sysdev_attribute *, const char *, size_t);
-
+#define _SYSDEV_EXT_ATTR(_name, _mode, _var, _show, _store) \
+ { _SYSDEV_ATTR(_name, _mode, _show, _store), \
+ &(_var) }
+#define SYSDEV_EXT_ATTR(_name, _mode, _var, _show, _store) \
+ struct sysdev_ext_attribute attr_##_name = \
+ _SYSDEV_EXT_ATTR(_name, _mode, _var, _show, _store);
#define _SYSDEV_ULONG_ATTR(_name, _mode, _var) \
{ _SYSDEV_ATTR(_name, _mode, sysdev_show_ulong, sysdev_store_ulong), \
&(_var) }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/