From 14f572fa38c55fbe369127b808a4a79b0bbec367 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 19 Oct 2009 11:07:05 +0100 Subject: mfd: Always initialise WM831x IRQ mutex This avoids crashes when running without interrupt support. Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz --- drivers/mfd/wm831x-irq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/wm831x-irq.c b/drivers/mfd/wm831x-irq.c index d3015dfb913..ac056ea6b66 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 */ -- cgit v1.2.3 From a8643430bc82aa3d272b21df2e1feb502bb8aacb Mon Sep 17 00:00:00 2001 From: Ilkka Koskinen Date: Tue, 20 Oct 2009 16:22:52 +0300 Subject: mfd: Do not dereference null pointer in twl4030 error path We are mistakenly dereferencing twl->client in the twl->client null checking path. Signed-off-by: Ilkka Koskinen Signed-off-by: Samuel Ortiz --- drivers/mfd/twl4030-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c index e832e975da6..a1c47ee95c0 100644 --- a/drivers/mfd/twl4030-core.c +++ b/drivers/mfd/twl4030-core.c @@ -795,7 +795,7 @@ twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id) twl->client = i2c_new_dummy(client->adapter, twl->address); if (!twl->client) { - dev_err(&twl->client->dev, + dev_err(&client->dev, "can't attach client %d\n", i); status = -ENOMEM; goto fail; -- cgit v1.2.3