Skip to content

Commit

Permalink
rtc: mc146818-lib: change return values of mc146818_get_time()
Browse files Browse the repository at this point in the history
No function is checking mc146818_get_time() return values yet, so
correct them to make them more customary.

Signed-off-by: Mateusz Jończyk <mat.jonczyk@o2.pl>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20211210200131.153887-3-mat.jonczyk@o2.pl
  • Loading branch information
Mateusz Jończyk authored and Alexandre Belloni committed Dec 16, 2021
1 parent 454f47f commit d35786b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/rtc/rtc-mc146818-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ unsigned int mc146818_get_time(struct rtc_time *time)
if (WARN_ON_ONCE((CMOS_READ(RTC_VALID) & 0x40) != 0)) {
spin_unlock_irqrestore(&rtc_lock, flags);
memset(time, 0xff, sizeof(*time));
return 0;
return -EIO;
}

/*
Expand Down Expand Up @@ -116,7 +116,7 @@ unsigned int mc146818_get_time(struct rtc_time *time)

time->tm_mon--;

return RTC_24H;
return 0;
}
EXPORT_SYMBOL_GPL(mc146818_get_time);

Expand Down

0 comments on commit d35786b

Please sign in to comment.