Skip to contentSkip to conversation

pwm: meson: Fix missing spin_lock_init()

PATCH New Wei Yongjun 3 participants 3 messages Sep 10, 2016 – Oct 21, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pwm: meson: Fix missing spin_lock_init()

From: Wei Yongjun <[email protected]>

The driver allocates the spinlock but not initialize it. Use spin_lock_init() on it to initialize it correctly.

This is detected by Coccinelle semantic patch.

---
 drivers/pwm/pwm-meson.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pwm/pwm-meson.c +1 -0
index bfbbe7f..778d088 100644
@@ -465,6 +465,7 @@ static int meson_pwm_probe(struct platform_device *pdev)
 	if (IS_ERR(meson->base))
 		return PTR_ERR(meson->base);
 
+	spin_lock_init(&meson->lock);
 	meson->chip.dev = &pdev->dev;
 	meson->chip.ops = &meson_pwm_ops;
 	meson->chip.base = -1;
#1 lore raw

PATCH 1/1 pwm: meson: Fix missing spin_lock_init()

Le 10/09/2016 08:38, Wei Yongjun a ?crit :

Quoted 18 lines

From: Wei Yongjun <[email protected]>

The driver allocates the spinlock but not initialize it. Use spin_lock_init() on it to initialize it correctly.

This is detected by Coccinelle semantic patch.

---
 drivers/pwm/pwm-meson.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pwm/pwm-meson.c +0 -0
index bfbbe7f..778d088 100644

drivers/pwm/pwm-meson.c static int meson_pwm_probe(struct platform_device *pdev) · line 471

Quoted 7 lines
drivers/pwm/pwm-meson.c +1 -0
@@ -465,6 +465,7 @@ static int meson_pwm_probe(struct platform_device *pdev)
 	if (IS_ERR(meson->base))
 		return PTR_ERR(meson->base);
 
+	spin_lock_init(&meson->lock);
 	meson->chip.dev = &pdev->dev;
 	meson->chip.ops = &meson_pwm_ops;
 	meson->chip.base = -1;

Thanks for the fix, but it was already posted earlier by Axel Lin <[email protected]>

Thierry will decide which one to merge.

Thanks,
Neil

#2 lore raw

PATCH 1/1 pwm: meson: Fix missing spin_lock_init()

Quoted 29 lines · Neil Armstrong

Le 10/09/2016 08:38, Wei Yongjun a ?crit :

Quoted 18 lines

From: Wei Yongjun <[email protected]>

The driver allocates the spinlock but not initialize it. Use spin_lock_init() on it to initialize it correctly.

This is detected by Coccinelle semantic patch.

---
 drivers/pwm/pwm-meson.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pwm/pwm-meson.c +0 -0
index bfbbe7f..778d088 100644

drivers/pwm/pwm-meson.c static int meson_pwm_probe(struct platform_device *pdev) · line 471

Quoted 7 lines
drivers/pwm/pwm-meson.c +1 -0
@@ -465,6 +465,7 @@ static int meson_pwm_probe(struct platform_device *pdev)
 	if (IS_ERR(meson->base))
 		return PTR_ERR(meson->base);
 
+	spin_lock_init(&meson->lock);
 	meson->chip.dev = &pdev->dev;
 	meson->chip.ops = &meson_pwm_ops;
 	meson->chip.base = -1;

Thanks for the fix, but it was already posted earlier by Axel Lin <[email protected]>

Quoted 3 lines

Thierry will decide which one to merge.

I've applied Axel's patch.

Thanks,
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-amlogic/attachments/20161021/c8c0227d/attachment.sig>