aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sysfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sysfs.h')
-rw-r--r--include/linux/sysfs.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 006c359e63c0..5b8f80f5aca6 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -36,6 +36,16 @@ struct attribute {
36#endif 36#endif
37}; 37};
38 38
39/**
40 * sysfs_attr_init - initialize a dynamically allocated sysfs attribute
41 * @attr: struct attribute to initialize
42 *
43 * Initialize a dynamically allocated struct attribute so we can
44 * make lockdep happy. This is a new requirement for attributes
45 * and initially this is only needed when lockdep is enabled.
46 * Lockdep gives a nice error when your attribute is added to
47 * sysfs if you don't have this.
48 */
39#ifdef CONFIG_DEBUG_LOCK_ALLOC 49#ifdef CONFIG_DEBUG_LOCK_ALLOC
40#define sysfs_attr_init(attr) \ 50#define sysfs_attr_init(attr) \
41do { \ 51do { \
@@ -90,6 +100,16 @@ struct bin_attribute {
90 struct vm_area_struct *vma); 100 struct vm_area_struct *vma);
91}; 101};
92 102
103/**
104 * sysfs_bin_attr_init - initialize a dynamically allocated bin_attribute
105 * @attr: struct bin_attribute to initialize
106 *
107 * Initialize a dynamically allocated struct bin_attribute so we
108 * can make lockdep happy. This is a new requirement for
109 * attributes and initially this is only needed when lockdep is
110 * enabled. Lockdep gives a nice error when your attribute is
111 * added to sysfs if you don't have this.
112 */
93#define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&bin_attr->attr) 113#define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&bin_attr->attr)
94 114
95struct sysfs_ops { 115struct sysfs_ops {