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>
This commit is contained in:
Alexandre Belloni 2019-12-14 23:10:14 +01:00
parent 38ce8e30f3
commit 8fd3d609a5
1 changed files with 1 additions and 13 deletions

View File

@ -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)