arm/kinetis: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt

Replace the spinlock/sched_lock pair in arm/kinetis 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:25:27 +08:00 • committed by Xiang Xiao
parent 8978be2939
commit 268e67ce3d

View file

@ -243,11 +243,9 @@ static void kinetis_tcd_free(struct kinetis_edmatcd_s *tcd)
* a TCD.
*/
flags = spin_lock_irqsave(&g_edma.lock);
sched_lock();
flags = spin_lock_irqsave_nopreempt(&g_edma.lock);
kinetis_tcd_free_nolock(tcd);
spin_unlock_irqrestore(&g_edma.lock, flags);
sched_unlock();
spin_unlock_irqrestore_nopreempt(&g_edma.lock, flags);
}
#endif
@ -455,8 +453,7 @@ static void kinetis_dmaterminate(struct kinetis_dmach_s *dmach, int result)
uint8_t regval8;
uint8_t chan;
flags = spin_lock_irqsave(&g_edma.lock);
sched_lock();
flags = spin_lock_irqsave_nopreempt(&g_edma.lock);
/* Disable channel ERROR interrupts */
@ -507,8 +504,7 @@ static void kinetis_dmaterminate(struct kinetis_dmach_s *dmach, int result)
dmach->arg = NULL;
dmach->state = KINETIS_DMA_IDLE;
spin_unlock_irqrestore(&g_edma.lock, flags);
sched_unlock();
spin_unlock_irqrestore_nopreempt(&g_edma.lock, flags);
}
/****************************************************************************