From: David S. Miller Date: Wed, 10 Sep 2008 20:36:13 +0000 (-0700) Subject: sparc32: Need to close openned RTC device just like sparc64. X-Git-Tag: firefly_0821_release~17814^2~45 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ab138c031f72f6d030afa1a06a3a537e85ae843e;p=firefly-linux-kernel-4.4.55.git sparc32: Need to close openned RTC device just like sparc64. Otherwise we get refcount problems. Signed-off-by: David S. Miller --- 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) 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; }