summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2019-12-15 01:10:14 +0300
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2019-12-18 12:37:59 +0300
commit8fd3d609a5c87ccff2327c9813d35723b9a6ac10 (patch)
treef4698bcfecb64bfff0f8894e3d5aec4f6ff9429b /drivers/rtc
parent38ce8e30f37e8cfcf789f5b2b197f517def3c2c6 (diff)
downloadlinux-8fd3d609a5c87ccff2327c9813d35723b9a6ac10.tar.xz
rtc: rv3029: simplify rv3029_set_alarm
It is unecessay to test alarm->enabled before calling rv3029_alarm_irq_enable. Link: https://lore.kernel.org/r/20191214221022.622482-9-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-rv3029c2.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/rtc/rtc-rv3029c2.c b/drivers/rtc/rtc-rv3029c2.c
index 631e4a998127..2d12d13ff747 100644
--- a/drivers/rtc/rtc-rv3029c2.c
+++ b/drivers/rtc/rtc-rv3029c2.c
@@ -440,19 +440,7 @@ static int rv3029_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
if (ret < 0)
return ret;
- if (alarm->enabled) {
- /* enable AIE irq */
- ret = rv3029_alarm_irq_enable(dev, 1);
- if (ret)
- return ret;
- } else {
- /* disable AIE irq */
- ret = rv3029_alarm_irq_enable(dev, 0);
- if (ret)
- return ret;
- }
-
- return 0;
+ return rv3029_alarm_irq_enable(dev, alarm->enabled);
}
static int rv3029_set_time(struct device *dev, struct rtc_time *tm)