mirror of
https://github.com/apache/nuttx.git
synced 2025-12-06 09:01:15 +08:00
renesas/rx65n: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt
Replace the spinlock/sched_lock pair in renesas/rx65n with
spin_lock_irqsave_nopreempt() to improve code clarity and consistency.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
This commit is contained in:
committed by
Xiang Xiao
parent
6c28a2b749
commit
53dd00328d
@@ -480,8 +480,7 @@ int up_rtc_gettime(struct timespec *tp)
|
||||
uint8_t regval;
|
||||
struct tm t;
|
||||
|
||||
flags = spin_lock_irqsave(&g_rtc_lock);
|
||||
sched_lock();
|
||||
flags = spin_lock_irqsave_nopreempt(&g_rtc_lock);
|
||||
|
||||
if (RTC.RCR2.BIT.START == 0)
|
||||
{
|
||||
@@ -549,8 +548,7 @@ int up_rtc_gettime(struct timespec *tp)
|
||||
UNUSED(mincnt);
|
||||
UNUSED(seccnt);
|
||||
|
||||
spin_unlock_irqrestore(&g_rtc_lock, flags);
|
||||
sched_unlock();
|
||||
spin_unlock_irqrestore_nopreempt(&g_rtc_lock, flags);
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user