Skip to content

Commit 9f70a40

Browse files
Robert ABELgregkh
authored andcommitted
sysfs: fix attribute_group bin file path on removal
Cody Schafer already fixed binary file creation for attribute groups, see [1]. This patch makes the appropriate changes for binary file removal of attribute groups. [1]: http://lkml.org/lkml/2014/2/27/832 Signed-off-by: Robert ABEL <rabel@cit-ec.uni-bielefeld.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 78e1da6 commit 9f70a40

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎fs/sysfs/group.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "sysfs.h"
1919

2020

21-
static void remove_files(struct kernfs_node *parent, struct kobject *kobj,
21+
static void remove_files(struct kernfs_node *parent,
2222
const struct attribute_group *grp)
2323
{
2424
struct attribute *const *attr;
@@ -29,7 +29,7 @@ static void remove_files(struct kernfs_node *parent, struct kobject *kobj,
2929
kernfs_remove_by_name(parent, (*attr)->name);
3030
if (grp->bin_attrs)
3131
for (bin_attr = grp->bin_attrs; *bin_attr; bin_attr++)
32-
sysfs_remove_bin_file(kobj, *bin_attr);
32+
kernfs_remove_by_name(parent, (*bin_attr)->attr.name);
3333
}
3434

3535
static int create_files(struct kernfs_node *parent, struct kobject *kobj,
@@ -62,7 +62,7 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj,
6262
break;
6363
}
6464
if (error) {
65-
remove_files(parent, kobj, grp);
65+
remove_files(parent, grp);
6666
goto exit;
6767
}
6868
}
@@ -79,7 +79,7 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj,
7979
break;
8080
}
8181
if (error)
82-
remove_files(parent, kobj, grp);
82+
remove_files(parent, grp);
8383
}
8484
exit:
8585
return error;
@@ -224,7 +224,7 @@ void sysfs_remove_group(struct kobject *kobj,
224224
kernfs_get(kn);
225225
}
226226

227-
remove_files(kn, kobj, grp);
227+
remove_files(kn, grp);
228228
if (grp->name)
229229
kernfs_remove(kn);
230230

0 commit comments

Comments
 (0)