From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org,
Krzysztof Kozlowski <k.kozlowski@samsung.com>
Subject: [PATCH v2 2/3] RTC: switch wakealarm attribute to DEVICE_ATTR_RW
Date: Thu, 23 Jul 2015 16:01:07 -0700 [thread overview]
Message-ID: <1437692468-24788-2-git-send-email-dmitry.torokhov@gmail.com> (raw)
In-Reply-To: <1437692468-24788-1-git-send-email-dmitry.torokhov@gmail.com>
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: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/rtc/rtc-sysfs.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/rtc/rtc-sysfs.c b/drivers/rtc/rtc-sysfs.c
index 2fbc11b..e3ce1dc 100644
--- a/drivers/rtc/rtc-sysfs.c
+++ b/drivers/rtc/rtc-sysfs.c
@@ -134,8 +134,7 @@ static struct attribute *rtc_attrs[] = {
ATTRIBUTE_GROUPS(rtc);
static ssize_t
-rtc_sysfs_show_wakealarm(struct device *dev, struct device_attribute *attr,
- char *buf)
+wakealarm_show(struct device *dev, struct device_attribute *attr, char *buf)
{
ssize_t retval;
unsigned long alarm;
@@ -159,7 +158,7 @@ rtc_sysfs_show_wakealarm(struct device *dev, struct device_attribute *attr,
}
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)
{
ssize_t retval;
@@ -221,8 +220,7 @@ rtc_sysfs_set_wakealarm(struct device *dev, struct device_attribute *attr,
retval = rtc_set_alarm(rtc, &alm);
return (retval < 0) ? retval : n;
}
-static DEVICE_ATTR(wakealarm, S_IRUGO | S_IWUSR,
- rtc_sysfs_show_wakealarm, rtc_sysfs_set_wakealarm);
+static DEVICE_ATTR_RW(wakealarm);
/* The reason to trigger an alarm with no process watching it (via sysfs)
--
2.5.0.rc2.392.g76e840b
next prev parent reply other threads:[~2015-07-23 23:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-23 23:01 [PATCH v2 1/3] RTC: make rtc_does_wakealarm() return boolean Dmitry Torokhov
2015-07-23 23:01 ` Dmitry Torokhov [this message]
2015-07-24 4:08 ` [PATCH v2 2/3] RTC: switch wakealarm attribute to DEVICE_ATTR_RW Krzysztof Kozlowski
2015-08-05 1:40 ` Alexandre Belloni
2015-07-23 23:01 ` [PATCH v2 3/3] RTC: switch to using is_visible() to control sysfs attributes Dmitry Torokhov
2015-07-24 4:10 ` Krzysztof Kozlowski
2015-08-05 1:41 ` Alexandre Belloni
2015-07-24 4:10 ` [PATCH v2 1/3] RTC: make rtc_does_wakealarm() return boolean Krzysztof Kozlowski
2015-08-05 1:40 ` Alexandre Belloni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1437692468-24788-2-git-send-email-dmitry.torokhov@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@free-electrons.com \
--cc=k.kozlowski@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rtc-linux@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome