linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] pwm: meson: Fix missing spin_lock_init()
@ 2016-09-10  6:38 Wei Yongjun
  2016-09-10 13:54 ` Neil Armstrong
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2016-09-10  6:38 UTC (permalink / raw)
  To: linus-amlogic

From: Wei Yongjun <weiyongjun1@huawei.com>

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.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/pwm/pwm-meson.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c
index bfbbe7f..778d088 100644
--- a/drivers/pwm/pwm-meson.c
+++ b/drivers/pwm/pwm-meson.c
@@ -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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-21  7:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-10  6:38 [PATCH -next] pwm: meson: Fix missing spin_lock_init() Wei Yongjun
2016-09-10 13:54 ` Neil Armstrong
2016-10-21  7:11   ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).