Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 388a8c35 authored by Oliver Schinagl's avatar Oliver Schinagl Committed by Greg Kroah-Hartman
Browse files

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: default avatarOliver Schinagl <oliver@schinagl.nl>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6ab9cea1
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -93,8 +93,8 @@ static int internal_create_group(struct kobject *kobj, int update,
	/* Updates may happen before the object has been instantiated */
	/* Updates may happen before the object has been instantiated */
	if (unlikely(update && !kobj->sd))
	if (unlikely(update && !kobj->sd))
		return -EINVAL;
		return -EINVAL;
	if (!grp->attrs) {
	if (!grp->attrs && !grp->bin_attrs) {
		WARN(1, "sysfs: attrs not set by subsystem for group: %s/%s\n",
		WARN(1, "sysfs: (bin_)attrs not set by subsystem for group: %s/%s\n",
			kobj->name, grp->name ? "" : grp->name);
			kobj->name, grp->name ? "" : grp->name);
		return -EINVAL;
		return -EINVAL;
	}
	}