Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rtc: mpc5121: let the core handle the alarm resolution

Set RTC_FEATURE_ALARM_RES_MINUTE, so the core knows alarms have a
resolution of a minute. Also, the core will properly round down the alarm
instead of up.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220309162301.61679-4-alexandre.belloni@bootlin.com

+1 -14
+1 -14
drivers/rtc/rtc-mpc5121.c
··· 210 210 struct mpc5121_rtc_data *rtc = dev_get_drvdata(dev); 211 211 struct mpc5121_rtc_regs __iomem *regs = rtc->regs; 212 212 213 - /* 214 - * the alarm has no seconds so deal with it 215 - */ 216 - if (alarm->time.tm_sec) { 217 - alarm->time.tm_sec = 0; 218 - alarm->time.tm_min++; 219 - if (alarm->time.tm_min >= 60) { 220 - alarm->time.tm_min = 0; 221 - alarm->time.tm_hour++; 222 - if (alarm->time.tm_hour >= 24) 223 - alarm->time.tm_hour = 0; 224 - } 225 - } 226 - 227 213 alarm->time.tm_mday = -1; 228 214 alarm->time.tm_mon = -1; 229 215 alarm->time.tm_year = -1; ··· 335 349 } 336 350 337 351 rtc->rtc->ops = &mpc5200_rtc_ops; 352 + set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->rtc->features); 338 353 rtc->rtc->uie_unsupported = 1; 339 354 rtc->rtc->range_min = RTC_TIMESTAMP_BEGIN_0000; 340 355 rtc->rtc->range_max = 65733206399ULL; /* 4052-12-31 23:59:59 */