Skip to contentSkip to conversation

SYSFS: fix attribute_group bin file path on removal

PATCH Superseded Robert ABEL 1 participant 1 message Apr 15, 2014 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

From 706a652d3653470a5caae589f6945498026c94c1 Mon Sep 17 00:00:00 2001
From: Robert ABEL <[email protected]>
Date: Tue, 15 Apr 2014 22:01:35 +0200
Subject: [PATCH] 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

---
 fs/sysfs/group.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
fs/sysfs/group.c +5 -5
index aa04068..7d2a860 100644
@@ -18,7 +18,7 @@
 #include "sysfs.h"
 
 
-static void remove_files(struct kernfs_node *parent, struct kobject *kobj,
+static void remove_files(struct kernfs_node *parent,
 			 const struct attribute_group *grp)
 {
 	struct attribute *const *attr;
@@ -29,7 +29,7 @@ static void remove_files(struct kernfs_node *parent, struct kobject *kobj,
 			kernfs_remove_by_name(parent, (*attr)->name);
 	if (grp->bin_attrs)
 		for (bin_attr = grp->bin_attrs; *bin_attr; bin_attr++)
-			sysfs_remove_bin_file(kobj, *bin_attr);
+			kernfs_remove_by_name(parent, (*bin_attr)->attr.name);
 }
 
 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,
 				break;
 		}
 		if (error) {
-			remove_files(parent, kobj, grp);
+			remove_files(parent, grp);
 			goto exit;
 		}
 	}
@@ -79,7 +79,7 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj,
 				break;
 		}
 		if (error)
-			remove_files(parent, kobj, grp);
+			remove_files(parent, grp);
 	}
 exit:
 	return error;
@@ -224,7 +224,7 @@ void sysfs_remove_group(struct kobject *kobj,
 		kernfs_get(kn);
 	}
 
-	remove_files(kn, kobj, grp);
+	remove_files(kn, grp);
 	if (grp->name)
 		kernfs_remove(kn);
 
Signature · 1 line
1.7.9.5