aboutsummaryrefslogtreecommitdiff
path: root/arch/sparc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/kernel/time.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c
index 698c45059fa..fa54d585f55 100644
--- a/arch/sparc/kernel/time.c
+++ b/arch/sparc/kernel/time.c
@@ -337,9 +337,12 @@ static int sbus_do_settimeofday(struct timespec *tv)
static int set_rtc_mmss(unsigned long secs)
{
struct rtc_device *rtc = rtc_class_open("rtc0");
+ int err = -1;
- if (rtc)
- return rtc_set_mmss(rtc, secs);
+ if (rtc) {
+ err = rtc_set_mmss(rtc, secs);
+ rtc_class_close(rtc);
+ }
- return -1;
+ return err;
}