diff options
-rw-r--r-- | arch/sparc/kernel/time.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c index 698c45059fa5..fa54d585f558 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) | |||
337 | static int set_rtc_mmss(unsigned long secs) | 337 | static int set_rtc_mmss(unsigned long secs) |
338 | { | 338 | { |
339 | struct rtc_device *rtc = rtc_class_open("rtc0"); | 339 | struct rtc_device *rtc = rtc_class_open("rtc0"); |
340 | int err = -1; | ||
340 | 341 | ||
341 | if (rtc) | 342 | if (rtc) { |
342 | return rtc_set_mmss(rtc, secs); | 343 | err = rtc_set_mmss(rtc, secs); |
344 | rtc_class_close(rtc); | ||
345 | } | ||
343 | 346 | ||
344 | return -1; | 347 | return err; |
345 | } | 348 | } |