rtc: Adjust failure return code for cmos_set_alarm()
[platform/kernel/linux-starfive.git] / drivers / rtc / rtc-cmos.c
index 696cfa7..2a1a83c 100644 (file)
@@ -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);