Przeglądaj źródła

rtc: pcf8563: don't alway enable the alarm

Allow setting the alarm and later enable it instead of enabling it
unconditionally.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Alexandre Belloni 7 lat temu
rodzic
commit
1856e0b2ac
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      drivers/rtc/rtc-pcf8563.c

+ 1 - 1
drivers/rtc/rtc-pcf8563.c

@@ -387,7 +387,7 @@ static int pcf8563_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *tm)
 	if (err)
 		return err;
 
-	return pcf8563_set_alarm_mode(client, 1);
+	return pcf8563_set_alarm_mode(client, !!tm->enabled);
 }
 
 static int pcf8563_irq_enable(struct device *dev, unsigned int enabled)