From: Zheng Yang Date: Thu, 4 Jun 2015 07:35:35 +0000 (+0800) Subject: rk1000: fix create sysfs file permission error. X-Git-Tag: firefly_0821_release~4078 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2d8f7edfaa275cb6d549c19addbb55a26c9d110f;p=firefly-linux-kernel-4.4.55.git rk1000: fix create sysfs file permission error. Wrong permission will case following warning: ------------[ cut here ]------------ WARNING: at drivers/base/core.c:576 device_create_file+0x74/0xa4() Attribute rkcontrl: write permission without 'store' Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.0 #247 Call trace: [] dump_backtrace+0x0/0x10c [] show_stack+0x10/0x1c [] dump_stack+0x1c/0x28 [] warn_slowpath_common+0x74/0x9c [] warn_slowpath_fmt+0x4c/0x58 [] device_create_file+0x70/0xa4 [] rk1000_probe+0x1d0/0x20c [] i2c_device_probe+0x9c/0xd4 [] driver_probe_device+0xd0/0x210 [] __driver_attach+0x60/0x90 [] bus_for_each_dev+0x60/0x88 [] driver_attach+0x1c/0x28 [] bus_add_driver+0xf4/0x210 [] driver_register+0xbc/0x138 [] i2c_register_driver+0x48/0xac [] rk1000_init+0x14/0x20 [] do_one_initcall+0x80/0x120 [] kernel_init_freeable+0x148/0x1e8 [] kernel_init+0x10/0xcc ---[ end trace 1cc1e45d37744cff ]--- Signed-off-by: Zheng Yang --- diff --git a/drivers/mfd/rk1000-core.c b/drivers/mfd/rk1000-core.c index 975f467165c5..1aa3d2ce5b9e 100755 --- a/drivers/mfd/rk1000-core.c +++ b/drivers/mfd/rk1000-core.c @@ -135,7 +135,7 @@ static ssize_t rk1000_show(struct device *dev, return 0; } -static DEVICE_ATTR(rkcontrl, 0666, rk1000_show, NULL); +static DEVICE_ATTR(rkcontrl, S_IRUGO, rk1000_show, NULL); static int __init bootloader_cvbs_setup(char *str)