Skip to contentSkip to conversation

ARM: OMAP: Use DEFINE_SPINLOCK() for spinlock

PATCH In review Chen Lifu 2 participants 3 messages Mar 27, 2021 – Mar 31, 2021

Subsystems (3)
lore
Share & tools
lore

Chen Lifu

author
#0 lore raw

PATCH 1/1 ARM: OMAP: Use DEFINE_SPINLOCK() for spinlock

From: Lifu Chen <[email protected]>

spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init().

---
 arch/arm/plat-omap/dma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm/plat-omap/dma.c +1 -2
index 1eb59003bdec..9f11de46aaa9 100644
@@ -85,7 +85,7 @@ static int dma_lch_count;
 static int dma_chan_count;
 static int omap_dma_reserve_channels;
 
-static spinlock_t dma_chan_lock;
+static DEFINE_SPINLOCK(dma_chan_lock);
 static struct omap_dma_lch *dma_chan;
 
 static inline void disable_lnk(int lch);
@@ -902,7 +902,6 @@ static int omap_system_dma_probe(struct platform_device *pdev)
 	if (!dma_chan)
 		return -ENOMEM;
 
-	spin_lock_init(&dma_chan_lock);
 	for (ch = 0; ch < dma_chan_count; ch++) {
 		omap_clear_dma(ch);
 
#1 lore raw
Quoted 4 lines · Chen Lifu

From: Lifu Chen <[email protected]>

spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init().

Thanks applying into omap-for-v5.13/soc.

Tony

author
#2 lore raw
Quoted 11 lines · Tony Lindgren
Quoted 4 lines · Chen Lifu

From: Lifu Chen <[email protected]>

spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init().

Thanks applying into omap-for-v5.13/soc.

Tony
.

Thanks!

---
Chen Lifu