diff options
| author | Mario Limonciello <[email protected]> | 2023-11-28 05:36:51 +0000 |
|---|---|---|
| committer | Alexandre Belloni <[email protected]> | 2023-12-17 21:33:54 +0000 |
| commit | 1311a8f0d4b23f58bbababa13623aa40b8ad4e0c (patch) | |
| tree | 4ad0f29cefb328949bdb80dd87233b2c817fe67b /drivers/rtc | |
| parent | rtc: mc146818-lib: Adjust failure return code for mc146818_get_time() (diff) | |
| download | kernel-1311a8f0d4b23f58bbababa13623aa40b8ad4e0c.tar.gz kernel-1311a8f0d4b23f58bbababa13623aa40b8ad4e0c.zip | |
rtc: Adjust failure return code for cmos_set_alarm()
When mc146818_avoid_UIP() fails to return a valid value, this is because
UIP didn't clear in the timeout period. Adjust the return code in this
case to -ETIMEDOUT.
Tested-by: Mateusz Jończyk <[email protected]>
Reviewed-by: Mateusz Jończyk <[email protected]>
Acked-by: Mateusz Jończyk <[email protected]>
Cc: <[email protected]>
Fixes: cdedc45c579f ("rtc: cmos: avoid UIP when reading alarm time")
Fixes: cd17420ebea5 ("rtc: cmos: avoid UIP when writing alarm time")
Signed-off-by: Mario Limonciello <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
Diffstat (limited to 'drivers/rtc')
| -rw-r--r-- | drivers/rtc/rtc-cmos.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index 696cfa7025de..2a1a83caf081 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c @@ -292,7 +292,7 @@ static int cmos_read_alarm(struct device *dev, struct rtc_wkalrm *t) /* This not only a rtc_op, but also called directly */ if (!is_valid_irq(cmos->irq)) - return -EIO; + return -ETIMEDOUT; /* Basic alarms only support hour, minute, and seconds fields. * Some also support day and month, for alarms up to a year in @@ -557,7 +557,7 @@ static int cmos_set_alarm(struct device *dev, struct rtc_wkalrm *t) * Use mc146818_avoid_UIP() to avoid this. */ if (!mc146818_avoid_UIP(cmos_set_alarm_callback, &p)) - return -EIO; + return -ETIMEDOUT; cmos->alarm_expires = rtc_tm_to_time64(&t->time); |
