]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
sysfs: Support is_visible() on binary attributes
authorEmilio López <emilio.lopez@collabora.co.uk>
Mon, 21 Sep 2015 13:38:20 +0000 (10:38 -0300)
committerOlof Johansson <olof@lixom.net>
Wed, 7 Oct 2015 22:05:31 +0000 (15:05 -0700)
commit7f5028cf6190407b7a632b0f30b83187577824cc
tree5f2ebc65f91ad1d816cefa2ea686bc76188456cf
parentf14ae099bdad32414ad968909973bfade9b37967
sysfs: Support is_visible() on binary attributes

According to the sysfs header file:

    "The returned value will replace static permissions defined in
     struct attribute or struct bin_attribute."

but this isn't the case, as is_visible is only called on struct attribute
only. This patch introduces a new is_bin_visible() function to implement
the same functionality for binary attributes, and updates documentation
accordingly.

Note that to keep functionality and code similar to that of normal
attributes, the mode is now checked as well to ensure it contains only
read/write permissions or SYSFS_PREALLOC.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Emilio López <emilio.lopez@collabora.co.uk>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
fs/sysfs/group.c
include/linux/sysfs.h