switch_class: Use appropriate device attribute permissions

These files are only readable.

WARNING: at drivers/base/core.c:576 device_create_file+0x3c/0x84()
Attribute state: write permission without 'store'
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Tainted: G        W    3.10.0-rc5-gee3e35b-09313-g02903cf #640
[<c0014220>] (unwind_backtrace+0x0/0x120) from [<c001212c>] (show_stack+0x10/0x14)
[<c001212c>] (show_stack+0x10/0x14) from [<c00841dc>] (warn_slowpath_common+0x4c/0x68)
[<c00841dc>] (warn_slowpath_common+0x4c/0x68) from [<c0084278>] (warn_slowpath_fmt+0x2c/0x3c)
[<c0084278>] (warn_slowpath_fmt+0x2c/0x3c) from [<c034459c>] (device_create_file+0x3c/0x84)
[<c034459c>] (device_create_file+0x3c/0x84) from [<c0540998>] (switch_dev_register+0x80/0xf0)
[<c0540998>] (switch_dev_register+0x80/0xf0) from [<c0c36aec>] (snd_usb_audio_init+0x54/0xbc)
[<c0c36aec>] (snd_usb_audio_init+0x54/0xbc) from [<c0008768>] (do_one_initcall+0xcc/0x180)
[<c0008768>] (do_one_initcall+0xcc/0x180) from [<c0c0029c>] (kernel_init_freeable+0xf4/0x1d0)
[<c0c0029c>] (kernel_init_freeable+0xf4/0x1d0) from [<c071ed18>] (kernel_init+0x8/0xe4)
[<c071ed18>] (kernel_init+0x8/0xe4) from [<c000e1b8>] (ret_from_fork+0x14/0x3c)

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
Stephen Boyd 2013-06-26 14:26:34 -07:00
parent a0ab343c58
commit 42dbb35a3b
1 changed files with 2 additions and 2 deletions

View File

@ -54,8 +54,8 @@ static ssize_t name_show(struct device *dev, struct device_attribute *attr,
return sprintf(buf, "%s\n", sdev->name);
}
static DEVICE_ATTR(state, S_IRUGO | S_IWUSR, state_show, NULL);
static DEVICE_ATTR(name, S_IRUGO | S_IWUSR, name_show, NULL);
static DEVICE_ATTR(state, S_IRUGO, state_show, NULL);
static DEVICE_ATTR(name, S_IRUGO, name_show, NULL);
void switch_set_state(struct switch_dev *sdev, int state)
{