Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Remove mips_rtc_lock 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>

authored by

Atsushi Nemoto and committed by
Ralf Baechle
e329331a 28622795

-7
-7
include/asm-mips/rtc.h
··· 14 14 15 15 #ifdef __KERNEL__ 16 16 17 - #include <linux/spinlock.h> 18 17 #include <linux/rtc.h> 19 18 #include <asm/time.h> 20 19 ··· 28 29 #define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */ 29 30 #define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */ 30 31 31 - static DEFINE_SPINLOCK(mips_rtc_lock); 32 - 33 32 static inline unsigned int get_rtc_time(struct rtc_time *time) 34 33 { 35 34 unsigned long nowtime; 36 35 37 - spin_lock(&mips_rtc_lock); 38 36 nowtime = rtc_get_time(); 39 37 to_tm(nowtime, time); 40 38 time->tm_year -= 1900; 41 - spin_unlock(&mips_rtc_lock); 42 39 43 40 return RTC_24H; 44 41 } ··· 44 49 unsigned long nowtime; 45 50 int ret; 46 51 47 - spin_lock(&mips_rtc_lock); 48 52 nowtime = mktime(time->tm_year+1900, time->tm_mon+1, 49 53 time->tm_mday, time->tm_hour, time->tm_min, 50 54 time->tm_sec); 51 55 ret = rtc_set_time(nowtime); 52 - spin_unlock(&mips_rtc_lock); 53 56 54 57 return ret; 55 58 }