summaryrefslogtreecommitdiff
path: root/include/linux/sysfs.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <greg@kroah.com>2004-06-21 01:14:21 -0700
committerGreg Kroah-Hartman <greg@kroah.com>2004-06-21 01:14:21 -0700
commit269986dcf4017c4bd44aa1f81d3b94349ca93296 (patch)
tree96a0a74ae12f39af1a7f5e2062dea3e8987f28ee /include/linux/sysfs.h
parent9a85e04ec3e527234d8a2210e6ba04d7af9a4298 (diff)
parentc4a9c8212b8e954da29dc2e9002842729c0ba6d1 (diff)
merge
Diffstat (limited to 'include/linux/sysfs.h')
-rw-r--r--include/linux/sysfs.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 4cb54379e85a..f94c7ac77c48 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -24,6 +24,27 @@ struct attribute_group {
};
+
+/**
+ * Use these macros to make defining attributes easier. See include/linux/device.h
+ * for examples..
+ */
+
+#define __ATTR(_name,_mode,_show,_store) { \
+ .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \
+ .show = _show, \
+ .store = _store, \
+}
+
+#define __ATTR_RO(_name) { \
+ .attr = { .name = __stringify(_name), .mode = 0444, .owner = THIS_MODULE }, \
+ .show = _name##_show, \
+}
+
+#define __ATTR_NULL { .attr = { .name = NULL } }
+
+#define attr_name(_attr) (_attr).attr.name
+
struct bin_attribute {
struct attribute attr;
size_t size;