From: Oliver Schinagl Date: Sun, 14 Jul 2013 23:05:56 +0000 (-0700) Subject: sysfs: prevent warning when only using binary attributes X-Git-Tag: v3.11-rc2~18^2~5 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=388a8c353d671d4ea2f638be84cfcbb912afdcf2;p=cascardo%2Flinux.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c index e5719c6095c3..09a1a25cd145 100644 --- a/fs/sysfs/group.c +++ b/fs/sysfs/group.c @@ -93,8 +93,8 @@ static int internal_create_group(struct kobject *kobj, int update, /* Updates may happen before the object has been instantiated */ if (unlikely(update && !kobj->sd)) return -EINVAL; - if (!grp->attrs) { - WARN(1, "sysfs: attrs not set by subsystem for group: %s/%s\n", + if (!grp->attrs && !grp->bin_attrs) { + WARN(1, "sysfs: (bin_)attrs not set by subsystem for group: %s/%s\n", kobj->name, grp->name ? "" : grp->name); return -EINVAL; }