]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
sparc32: Need to close openned RTC device just like sparc64.
authorDavid S. Miller <davem@davemloft.net>
Wed, 10 Sep 2008 20:36:13 +0000 (13:36 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Sep 2008 20:36:13 +0000 (13:36 -0700)
Otherwise we get refcount problems.

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/kernel/time.c

index 698c45059fa5442ee496eae4a618c7afa789edb2..fa54d585f558c3bcbe125d7c532a362263a2c50a 100644 (file)
@@ -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;
 }