aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-14 00:53:18 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-14 00:53:18 -0500
commit63f4f7e8df6c504f39c6493799b54775916030d6 (patch)
treeb8dc15df1ae7710bbbb51bd1ef8f1c7011f17fcd /fs/sysfs
parent4bfc89d26a0d177a79574fc1b54fc728e3bb8b4e (diff)
parentebaf31c46cce0dc8a6ed690b5456b295aa7586a6 (diff)
Merge tag 'chrome-platform-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform
Pull chrome platform updates from Olof Johansson: "Here's the branch of chrome platform changes for v4.4. Some have been queued up for the full 4.3 release cycle since I forgot to send them in for that round (rebased early on to deal with fixes conflicts). Most of these enable EC communication stuff -- Pixel 2015 support, enabling building for ARM64 platforms, and a few fixes for memory leaks. There's also a patch in here to allow reading/writing the verified boot context, which depends on a sysfs patch acked by Greg" * tag 'chrome-platform-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/olof/chrome-platform: platform/chrome: Fix i2c-designware adapter name platform/chrome: Support reading/writing the vboot context sysfs: Support is_visible() on binary attributes platform/chrome: cros_ec: Fix possible leak in led_rgb_store() platform/chrome: cros_ec: Fix leak in sequence_store() platform/chrome: Enable Chrome platforms on 64-bit ARM platform/chrome: cros_ec_dev - Add a platform device ID table platform/chrome: cros_ec_lpc - Add support for Google Pixel 2 platform/chrome: cros_ec_lpc - Use existing function to check EC result platform/chrome: Make depends on MFD_CROS_EC instead CROS_EC_PROTO Revert "platform/chrome: Don't make CHROME_PLATFORMS depends on X86 || ARM"
Diffstat (limited to 'fs/sysfs')
-rw-r--r--fs/sysfs/group.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c
index e1236594fffe..dc1358b5ec95 100644
--- a/fs/sysfs/group.c
+++ b/fs/sysfs/group.c
@@ -73,13 +73,26 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj,
73 } 73 }
74 74
75 if (grp->bin_attrs) { 75 if (grp->bin_attrs) {
76 for (bin_attr = grp->bin_attrs; *bin_attr; bin_attr++) { 76 for (i = 0, bin_attr = grp->bin_attrs; *bin_attr; i++, bin_attr++) {
77 umode_t mode = (*bin_attr)->attr.mode;
78
77 if (update) 79 if (update)
78 kernfs_remove_by_name(parent, 80 kernfs_remove_by_name(parent,
79 (*bin_attr)->attr.name); 81 (*bin_attr)->attr.name);
82 if (grp->is_bin_visible) {
83 mode = grp->is_bin_visible(kobj, *bin_attr, i);
84 if (!mode)
85 continue;
86 }
87
88 WARN(mode & ~(SYSFS_PREALLOC | 0664),
89 "Attribute %s: Invalid permissions 0%o\n",
90 (*bin_attr)->attr.name, mode);
91
92 mode &= SYSFS_PREALLOC | 0664;
80 error = sysfs_add_file_mode_ns(parent, 93 error = sysfs_add_file_mode_ns(parent,
81 &(*bin_attr)->attr, true, 94 &(*bin_attr)->attr, true,
82 (*bin_attr)->attr.mode, NULL); 95 mode, NULL);
83 if (error) 96 if (error)
84 break; 97 break;
85 } 98 }