mirror of
https://github.com/apache/nuttx.git
synced 2026-10-03 20:27:53 +00:00
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:
parent
8978be2939
commit
268e67ce3d
1 changed files with 4 additions and 8 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue