From: Mark Brown Date: Mon, 19 Oct 2009 10:07:05 +0000 (+0100) Subject: mfd: Always initialise WM831x IRQ mutex X-Git-Tag: v2.6.32-rc6~47^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=14f572fa38c55fbe369127b808a4a79b0bbec367;p=profile%2Fcommon%2Fkernel-common.git mfd: Always initialise WM831x IRQ mutex This avoids crashes when running without interrupt support. Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz --- diff --git a/drivers/mfd/wm831x-irq.c b/drivers/mfd/wm831x-irq.c index d3015df..ac056ea 100644 --- a/drivers/mfd/wm831x-irq.c +++ b/drivers/mfd/wm831x-irq.c @@ -507,6 +507,8 @@ int wm831x_irq_init(struct wm831x *wm831x, int irq) { int i, ret; + mutex_init(&wm831x->irq_lock); + if (!irq) { dev_warn(wm831x->dev, "No interrupt specified - functionality limited\n"); @@ -521,7 +523,6 @@ int wm831x_irq_init(struct wm831x *wm831x, int irq) } wm831x->irq = irq; - mutex_init(&wm831x->irq_lock); INIT_WORK(&wm831x->irq_work, wm831x_irq_worker); /* Mask the individual interrupt sources */