From 268e67ce3dba5657218343a1e6787c23fcde8604 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 4 Nov 2025 13:25:27 +0800 Subject: [PATCH] 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 --- arch/arm/src/kinetis/kinetis_edma.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/arm/src/kinetis/kinetis_edma.c b/arch/arm/src/kinetis/kinetis_edma.c index db5318ff069..a44cbc0be5a 100644 --- a/arch/arm/src/kinetis/kinetis_edma.c +++ b/arch/arm/src/kinetis/kinetis_edma.c @@ -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); } /****************************************************************************