diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-04-30 12:19:28 +0100 |
---|---|---|
committer | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-04-30 12:19:28 +0100 |
commit | d5aa207e46ff7ee838683a7d95ecf46fe42a9a56 (patch) | |
tree | 2fe7cf50bb45a3ca94f095695bab5414fa56c1f3 /arch/arm/mach-integrator | |
parent | a6ad57fb4b5e9d68553f4440377b99f75588fa88 (diff) | |
download | op-kernel-dev-d5aa207e46ff7ee838683a7d95ecf46fe42a9a56.zip op-kernel-dev-d5aa207e46ff7ee838683a7d95ecf46fe42a9a56.tar.gz |
[PATCH] ARM: RTC: allow driver methods to return error
Allow RTC drivers to return error codes from their read_time
or read_alarm methods.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-integrator')
-rw-r--r-- | arch/arm/mach-integrator/time.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/arch/arm/mach-integrator/time.c b/arch/arm/mach-integrator/time.c index 20729de..1a844ca 100644 --- a/arch/arm/mach-integrator/time.c +++ b/arch/arm/mach-integrator/time.c @@ -40,25 +40,32 @@ static int integrator_set_rtc(void) return 1; } -static void rtc_read_alarm(struct rtc_wkalrm *alrm) +static int rtc_read_alarm(struct rtc_wkalrm *alrm) { rtc_time_to_tm(readl(rtc_base + RTC_MR), &alrm->time); + return 0; } -static int rtc_set_alarm(struct rtc_wkalrm *alrm) +static inline int rtc_set_alarm(struct rtc_wkalrm *alrm) { unsigned long time; int ret; - ret = rtc_tm_to_time(&alrm->time, &time); + /* + * At the moment, we can only deal with non-wildcarded alarm times. + */ + ret = rtc_valid_tm(&alrm->time); + if (ret == 0) + ret = rtc_tm_to_time(&alrm->time, &time); if (ret == 0) writel(time, rtc_base + RTC_MR); return ret; } -static void rtc_read_time(struct rtc_time *tm) +static int rtc_read_time(struct rtc_time *tm) { rtc_time_to_tm(readl(rtc_base + RTC_DR), tm); + return 0; } /* @@ -69,7 +76,7 @@ static void rtc_read_time(struct rtc_time *tm) * edge of the 1Hz clock, we must write the time one second * in advance. */ -static int rtc_set_time(struct rtc_time *tm) +static inline int rtc_set_time(struct rtc_time *tm) { unsigned long time; int ret; |