Skip to content

Commit

Permalink
sparc32: Need to close openned RTC device just like sparc64.
Browse files Browse the repository at this point in the history
Otherwise we get refcount problems.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Sep 10, 2008
1 parent 90158d8 commit ab138c0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions arch/sparc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit ab138c0

Please sign in to comment.