diff options
author | Randy.Dunlap <rdunlap@xenotime.net> | 2006-07-11 02:05:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-26 00:08:39 -0400 |
commit | 995982ca79d9262869513948ec7c540f32035491 (patch) | |
tree | 08c9a655a210388dce467400aa11484cfd2b230b /fs/sysfs/bin.c | |
parent | 10188012daa586ae7fcbef272e4db4f404741adf (diff) |
sysfs_remove_bin_file: no return value, dump_stack on error
Make sysfs_remove_bin_file() void. If it detects an error,
printk the file name and call dump_stack().
sysfs_hash_and_remove() now returns an error code indicating
its success or failure so that sysfs_remove_bin_file() can
know success/failure.
Convert the only driver that checked the return value of
sysfs_remove_bin_file().
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs/bin.c')
-rw-r--r-- | fs/sysfs/bin.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c index c16a93c353c0..98022e41cda1 100644 --- a/fs/sysfs/bin.c +++ b/fs/sysfs/bin.c | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include <linux/errno.h> | 11 | #include <linux/errno.h> |
12 | #include <linux/fs.h> | 12 | #include <linux/fs.h> |
13 | #include <linux/kernel.h> | ||
13 | #include <linux/kobject.h> | 14 | #include <linux/kobject.h> |
14 | #include <linux/module.h> | 15 | #include <linux/module.h> |
15 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
@@ -176,7 +177,6 @@ const struct file_operations bin_fops = { | |||
176 | * sysfs_create_bin_file - create binary file for object. | 177 | * sysfs_create_bin_file - create binary file for object. |
177 | * @kobj: object. | 178 | * @kobj: object. |
178 | * @attr: attribute descriptor. | 179 | * @attr: attribute descriptor. |
179 | * | ||
180 | */ | 180 | */ |
181 | 181 | ||
182 | int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr) | 182 | int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr) |
@@ -191,13 +191,16 @@ int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr) | |||
191 | * sysfs_remove_bin_file - remove binary file for object. | 191 | * sysfs_remove_bin_file - remove binary file for object. |
192 | * @kobj: object. | 192 | * @kobj: object. |
193 | * @attr: attribute descriptor. | 193 | * @attr: attribute descriptor. |
194 | * | ||
195 | */ | 194 | */ |
196 | 195 | ||
197 | int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr) | 196 | void sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr) |
198 | { | 197 | { |
199 | sysfs_hash_and_remove(kobj->dentry,attr->attr.name); | 198 | if (sysfs_hash_and_remove(kobj->dentry, attr->attr.name) < 0) { |
200 | return 0; | 199 | printk(KERN_ERR "%s: " |
200 | "bad dentry or inode or no such file: \"%s\"\n", | ||
201 | __FUNCTION__, attr->attr.name); | ||
202 | dump_stack(); | ||
203 | } | ||
201 | } | 204 | } |
202 | 205 | ||
203 | EXPORT_SYMBOL_GPL(sysfs_create_bin_file); | 206 | EXPORT_SYMBOL_GPL(sysfs_create_bin_file); |