Skip to content

Commit

Permalink
Remove mips_rtc_lock
Browse files Browse the repository at this point in the history
    
The mips_rtc_lock is no longer needed because RTC operations should be
protected already by other mechanism. (rtc_lock, local_irq_save, etc.)
    
Also, locking whole rtc_get_time/rtc_set_time should be avoided while
some RTC routines might take very long time (a few seconds).
    
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Atsushi Nemoto authored and Ralf Baechle committed Nov 7, 2005
1 parent 2862279 commit e329331
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions include/asm-mips/rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#ifdef __KERNEL__

#include <linux/spinlock.h>
#include <linux/rtc.h>
#include <asm/time.h>

Expand All @@ -29,17 +28,13 @@
#define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */
#define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */

static DEFINE_SPINLOCK(mips_rtc_lock);

static inline unsigned int get_rtc_time(struct rtc_time *time)
{
unsigned long nowtime;

spin_lock(&mips_rtc_lock);
nowtime = rtc_get_time();
to_tm(nowtime, time);
time->tm_year -= 1900;
spin_unlock(&mips_rtc_lock);

return RTC_24H;
}
Expand All @@ -49,12 +44,10 @@ static inline int set_rtc_time(struct rtc_time *time)
unsigned long nowtime;
int ret;

spin_lock(&mips_rtc_lock);
nowtime = mktime(time->tm_year+1900, time->tm_mon+1,
time->tm_mday, time->tm_hour, time->tm_min,
time->tm_sec);
ret = rtc_set_time(nowtime);
spin_unlock(&mips_rtc_lock);

return ret;
}
Expand Down

0 comments on commit e329331

Please sign in to comment.