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

Commit 97521978 authored by dyoung@redhat.com's avatar dyoung@redhat.com Committed by Greg Kroah-Hartman
Browse files

driver core: print sysfs attribute name when warning about bogus permissions



Make it obvious to see what attribute is using bogus permissions.

Signed-off-by: default avatarDave Young <dyoung@redhat.com>
Acked-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1c04fc35
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -572,9 +572,11 @@ int device_create_file(struct device *dev,

	if (dev) {
		WARN(((attr->attr.mode & S_IWUGO) && !attr->store),
				"Write permission without 'store'\n");
			"Attribute %s: write permission without 'store'\n",
			attr->attr.name);
		WARN(((attr->attr.mode & S_IRUGO) && !attr->show),
				"Read permission without 'show'\n");
			"Attribute %s: read permission without 'show'\n",
			attr->attr.name);
		error = sysfs_create_file(&dev->kobj, &attr->attr);
	}