xtensa/esp32: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt

Replace the spinlock/sched_lock pair in xtensa/esp32 with
    spin_lock_irqsave_nopreempt() to improve code clarity and consistency.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
This commit is contained in:
wangchengdong
2025-11-04 13:27:25 +08:00
committed by Xiang Xiao
parent 53dd00328d
commit 97b24a1a0b
+2 -4
View File
@@ -2189,8 +2189,7 @@ int up_rtc_cancelalarm(enum alm_id_e alarmid)
if (cbinfo->ac_cb != NULL) if (cbinfo->ac_cb != NULL)
{ {
sched_lock(); flags = spin_lock_irqsave_nopreempt(&g_rtc_lock);
flags = spin_lock_irqsave(&g_rtc_lock);
/* Stop and delete the alarm */ /* Stop and delete the alarm */
@@ -2201,8 +2200,7 @@ int up_rtc_cancelalarm(enum alm_id_e alarmid)
cbinfo->deadline_us = 0; cbinfo->deadline_us = 0;
cbinfo->alarm_hdl = NULL; cbinfo->alarm_hdl = NULL;
spin_unlock_irqrestore(&g_rtc_lock, flags); spin_unlock_irqrestore_nopreempt(&g_rtc_lock, flags);
sched_unlock();
ret = OK; ret = OK;
} }