Skip to content

Commit 388a8c3

Browse files
oliv3rgregkh
authored andcommitted
sysfs: prevent warning when only using binary attributes
When only using bin_attrs instead of attrs the kernel prints a warning and refuses to create the sysfs entry. This fixes that. Signed-off-by: Oliver Schinagl <oliver@schinagl.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6ab9cea commit 388a8c3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎fs/sysfs/group.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ static int internal_create_group(struct kobject *kobj, int update,
9393
/* Updates may happen before the object has been instantiated */
9494
if (unlikely(update && !kobj->sd))
9595
return -EINVAL;
96-
if (!grp->attrs) {
97-
WARN(1, "sysfs: attrs not set by subsystem for group: %s/%s\n",
96+
if (!grp->attrs && !grp->bin_attrs) {
97+
WARN(1, "sysfs: (bin_)attrs not set by subsystem for group: %s/%s\n",
9898
kobj->name, grp->name ? "" : grp->name);
9999
return -EINVAL;
100100
}

0 commit comments

Comments
 (0)