[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080902112635.3F0ED3E6A00@basil.firstfloor.org>
Date: Tue, 2 Sep 2008 13:26:35 +0200 (CEST)
From: Andi Kleen <andi@...stfloor.org>
To: x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] [2/3] sysfs: Add utility macros for declaring generic extended sysdev attributes
This is similar to _SYSDEV_ULONG_ATTR, but allows to use
Needed for followup patch.
Signed-off-by: Andi Kleen <ak@...ux.intel.com>
---
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@...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