Skip to contentSkip to conversation

soc: ixp4xx: qmgr: Use DEFINE_SPINLOCK() for spinlock

PATCH In review Yang Yingliang 2 participants 2 messages Mar 31, 2021 Arm/Intel IXP4XX Arm architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc: ixp4xx: qmgr: Use DEFINE_SPINLOCK() for spinlock

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

---
 drivers/soc/ixp4xx/ixp4xx-qmgr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/soc/ixp4xx/ixp4xx-qmgr.c +1 -2
index 8c968382cea7..dde3b668eb40 100644
@@ -16,7 +16,7 @@
 static struct qmgr_regs __iomem *qmgr_regs;
 static int qmgr_irq_1;
 static int qmgr_irq_2;
-static spinlock_t qmgr_lock;
+static DEFINE_SPINLOCK(qmgr_lock);
 static u32 used_sram_bitmap[4]; /* 128 16-dword pages */
 static void (*irq_handlers[QUEUES])(void *pdev);
 static void *irq_pdevs[QUEUES];
@@ -434,7 +434,6 @@ static int ixp4xx_qmgr_probe(struct platform_device *pdev)
 	}
 
 	used_sram_bitmap[0] = 0xF; /* 4 first pages reserved for config */
-	spin_lock_init(&qmgr_lock);
 
 	dev_info(dev, "IXP4xx Queue Manager initialized.\n");
 	return 0;
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Yang Yingliang

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

That's right.

Quoted 2 lines
Quoted 25 lines
---
 drivers/soc/ixp4xx/ixp4xx-qmgr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/soc/ixp4xx/ixp4xx-qmgr.c +1 -2
index 8c968382cea7..dde3b668eb40 100644
@@ -16,7 +16,7 @@
 static struct qmgr_regs __iomem *qmgr_regs;
 static int qmgr_irq_1;
 static int qmgr_irq_2;
-static spinlock_t qmgr_lock;
+static DEFINE_SPINLOCK(qmgr_lock);
 static u32 used_sram_bitmap[4]; /* 128 16-dword pages */
 static void (*irq_handlers[QUEUES])(void *pdev);
 static void *irq_pdevs[QUEUES];
@@ -434,7 +434,6 @@ static int ixp4xx_qmgr_probe(struct platform_device *pdev)
 	}
 
 	used_sram_bitmap[0] = 0xF; /* 4 first pages reserved for config */
-	spin_lock_init(&qmgr_lock);
 
 	dev_info(dev, "IXP4xx Queue Manager initialized.\n");
 	return 0;
Signature · 5 lines
Krzysztof Hałasa

Sieć Badawcza Łukasiewicz
Przemysłowy Instytut Automatyki i Pomiarów PIAP
Al. Jerozolimskie 202, 02-486 Warszawa