Commit a17ccd1c authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Alexandre Belloni

rtc: switch wakealarm attribute to DEVICE_ATTR_RW

Instead of using older style DEVICE_ATTR for wakealarm attribute let's
switch to using DEVICE_ATTR_RW that ensures consistent across the kernel
permissions on the attribute.
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
parent df100c01
...@@ -134,8 +134,7 @@ static struct attribute *rtc_attrs[] = { ...@@ -134,8 +134,7 @@ static struct attribute *rtc_attrs[] = {
ATTRIBUTE_GROUPS(rtc); ATTRIBUTE_GROUPS(rtc);
static ssize_t static ssize_t
rtc_sysfs_show_wakealarm(struct device *dev, struct device_attribute *attr, wakealarm_show(struct device *dev, struct device_attribute *attr, char *buf)
char *buf)
{ {
ssize_t retval; ssize_t retval;
unsigned long alarm; unsigned long alarm;
...@@ -159,7 +158,7 @@ rtc_sysfs_show_wakealarm(struct device *dev, struct device_attribute *attr, ...@@ -159,7 +158,7 @@ rtc_sysfs_show_wakealarm(struct device *dev, struct device_attribute *attr,
} }
static ssize_t static ssize_t
rtc_sysfs_set_wakealarm(struct device *dev, struct device_attribute *attr, wakealarm_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t n) const char *buf, size_t n)
{ {
ssize_t retval; ssize_t retval;
...@@ -221,8 +220,7 @@ rtc_sysfs_set_wakealarm(struct device *dev, struct device_attribute *attr, ...@@ -221,8 +220,7 @@ rtc_sysfs_set_wakealarm(struct device *dev, struct device_attribute *attr,
retval = rtc_set_alarm(rtc, &alm); retval = rtc_set_alarm(rtc, &alm);
return (retval < 0) ? retval : n; return (retval < 0) ? retval : n;
} }
static DEVICE_ATTR(wakealarm, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(wakealarm);
rtc_sysfs_show_wakealarm, rtc_sysfs_set_wakealarm);
/* The reason to trigger an alarm with no process watching it (via sysfs) /* The reason to trigger an alarm with no process watching it (via sysfs)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment