Skip to content

Commit

Permalink
driver core: print sysfs attribute name when warning about bogus perm…
Browse files Browse the repository at this point in the history
…issions

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

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
dyoung@redhat.com authored and Greg Kroah-Hartman committed May 21, 2013
1 parent 1c04fc3 commit 9752197
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 9752197

Please sign in to comment.