summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-09-10 13:36:13 -0700
committerDavid S. Miller <davem@davemloft.net>2008-09-10 13:36:13 -0700
commitab138c031f72f6d030afa1a06a3a537e85ae843e (patch)
tree96dbd2725e1f9cc11ed5f4639c257744dfae090f /arch
parent90158d84eb20fa15e3c8010b570f3ea2c925121d (diff)
downloadop-kernel-dev-ab138c031f72f6d030afa1a06a3a537e85ae843e.zip
op-kernel-dev-ab138c031f72f6d030afa1a06a3a537e85ae843e.tar.gz
sparc32: Need to close openned RTC device just like sparc64.
Otherwise we get refcount problems. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-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 698c450..fa54d58 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;
}
OpenPOWER on IntegriCloud