diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/debugfs.h | 13 | ||||
-rw-r--r-- | include/linux/sysfs.h | 7 |
2 files changed, 17 insertions, 3 deletions
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index f7a7b86f6eef..a5fa6a6eede8 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -17,6 +17,10 @@ | |||
17 | 17 | ||
18 | #include <linux/fs.h> | 18 | #include <linux/fs.h> |
19 | 19 | ||
20 | #include <linux/types.h> | ||
21 | |||
22 | struct file_operations; | ||
23 | |||
20 | #if defined(CONFIG_DEBUG_FS) | 24 | #if defined(CONFIG_DEBUG_FS) |
21 | struct dentry *debugfs_create_file(const char *name, mode_t mode, | 25 | struct dentry *debugfs_create_file(const char *name, mode_t mode, |
22 | struct dentry *parent, void *data, | 26 | struct dentry *parent, void *data, |
@@ -36,6 +40,9 @@ struct dentry *debugfs_create_bool(const char *name, mode_t mode, | |||
36 | struct dentry *parent, u32 *value); | 40 | struct dentry *parent, u32 *value); |
37 | 41 | ||
38 | #else | 42 | #else |
43 | |||
44 | #include <linux/err.h> | ||
45 | |||
39 | /* | 46 | /* |
40 | * We do not return NULL from these functions if CONFIG_DEBUG_FS is not enabled | 47 | * We do not return NULL from these functions if CONFIG_DEBUG_FS is not enabled |
41 | * so users have a chance to detect if there was a real error or not. We don't | 48 | * so users have a chance to detect if there was a real error or not. We don't |
@@ -68,21 +75,21 @@ static inline struct dentry *debugfs_create_u8(const char *name, mode_t mode, | |||
68 | 75 | ||
69 | static inline struct dentry *debugfs_create_u16(const char *name, mode_t mode, | 76 | static inline struct dentry *debugfs_create_u16(const char *name, mode_t mode, |
70 | struct dentry *parent, | 77 | struct dentry *parent, |
71 | u8 *value) | 78 | u16 *value) |
72 | { | 79 | { |
73 | return ERR_PTR(-ENODEV); | 80 | return ERR_PTR(-ENODEV); |
74 | } | 81 | } |
75 | 82 | ||
76 | static inline struct dentry *debugfs_create_u32(const char *name, mode_t mode, | 83 | static inline struct dentry *debugfs_create_u32(const char *name, mode_t mode, |
77 | struct dentry *parent, | 84 | struct dentry *parent, |
78 | u8 *value) | 85 | u32 *value) |
79 | { | 86 | { |
80 | return ERR_PTR(-ENODEV); | 87 | return ERR_PTR(-ENODEV); |
81 | } | 88 | } |
82 | 89 | ||
83 | static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode, | 90 | static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode, |
84 | struct dentry *parent, | 91 | struct dentry *parent, |
85 | u8 *value) | 92 | u32 *value) |
86 | { | 93 | { |
87 | return ERR_PTR(-ENODEV); | 94 | return ERR_PTR(-ENODEV); |
88 | } | 95 | } |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 6f502ff7902a..38b58b30814a 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -99,6 +99,9 @@ sysfs_create_file(struct kobject *, const struct attribute *); | |||
99 | extern int | 99 | extern int |
100 | sysfs_update_file(struct kobject *, const struct attribute *); | 100 | sysfs_update_file(struct kobject *, const struct attribute *); |
101 | 101 | ||
102 | extern int | ||
103 | sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode); | ||
104 | |||
102 | extern void | 105 | extern void |
103 | sysfs_remove_file(struct kobject *, const struct attribute *); | 106 | sysfs_remove_file(struct kobject *, const struct attribute *); |
104 | 107 | ||
@@ -140,6 +143,10 @@ static inline int sysfs_update_file(struct kobject * k, const struct attribute * | |||
140 | { | 143 | { |
141 | return 0; | 144 | return 0; |
142 | } | 145 | } |
146 | static inline int sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode) | ||
147 | { | ||
148 | return 0; | ||
149 | } | ||
143 | 150 | ||
144 | static inline void sysfs_remove_file(struct kobject * k, const struct attribute * a) | 151 | static inline void sysfs_remove_file(struct kobject * k, const struct attribute * a) |
145 | { | 152 | { |