summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorJérémy Lefaure <jeremy.lefaure@lse.epita.fr>2017-04-21 22:19:45 -0400
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-04-28 21:52:24 +0300
commita8fe342856e5bce71a43201eb2870bd059483d2f (patch)
treea350c416ca83c028512d98ac94ae4c8ee5c5933b /drivers/platform
parentf9ac89f5ad613b462339e845aeb8494646fd9be2 (diff)
platform/x86: asus-wmi: fix cpufv sysfs file permission
The cpufv sysfs file is defined as readable by anyone even if the attribute does not have a show function. The result of every read is an IO error. This file should be write only. Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/asus-wmi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index d817e6327fec..a92255400d5c 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1757,7 +1757,7 @@ ASUS_WMI_CREATE_DEVICE_ATTR(cardr, 0644, ASUS_WMI_DEVID_CARDREADER);
ASUS_WMI_CREATE_DEVICE_ATTR(lid_resume, 0644, ASUS_WMI_DEVID_LID_RESUME);
ASUS_WMI_CREATE_DEVICE_ATTR(als_enable, 0644, ASUS_WMI_DEVID_ALS_ENABLE);
-static ssize_t store_cpufv(struct device *dev, struct device_attribute *attr,
+static ssize_t cpufv_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
int value, rv;
@@ -1774,7 +1774,7 @@ static ssize_t store_cpufv(struct device *dev, struct device_attribute *attr,
return count;
}
-static DEVICE_ATTR(cpufv, S_IRUGO | S_IWUSR, NULL, store_cpufv);
+static DEVICE_ATTR_WO(cpufv);
static struct attribute *platform_attributes[] = {
&dev_attr_cpufv.attr,