summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/pcf50633-core.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2012-12-25 10:52:49 +0800
committerSamuel Ortiz <sameo@linux.intel.com>2013-01-22 03:05:33 +0100
commitb30dd8f2e5e6a1b31b89d93d85942055b97327c2 (patch)
tree85ba2590eb56c60765282f3559a3a7a1b7229927 /drivers/mfd/pcf50633-core.c
parent2429d863868edb611f033c9ce4db519fbc270240 (diff)
downloadop-kernel-dev-b30dd8f2e5e6a1b31b89d93d85942055b97327c2.zip
op-kernel-dev-b30dd8f2e5e6a1b31b89d93d85942055b97327c2.tar.gz
mfd: pcf50633: Init pcf->dev before using it
Current code uses pcf->dev in the dev_err call before setting it to &client->dev. Fix it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/pcf50633-core.c')
-rw-r--r--drivers/mfd/pcf50633-core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
index 64803f1..d115673 100644
--- a/drivers/mfd/pcf50633-core.c
+++ b/drivers/mfd/pcf50633-core.c
@@ -208,6 +208,8 @@ static int pcf50633_probe(struct i2c_client *client,
if (!pcf)
return -ENOMEM;
+ i2c_set_clientdata(client, pcf);
+ pcf->dev = &client->dev;
pcf->pdata = pdata;
mutex_init(&pcf->lock);
@@ -219,9 +221,6 @@ static int pcf50633_probe(struct i2c_client *client,
return ret;
}
- i2c_set_clientdata(client, pcf);
- pcf->dev = &client->dev;
-
version = pcf50633_reg_read(pcf, 0);
variant = pcf50633_reg_read(pcf, 1);
if (version < 0 || variant < 0) {
OpenPOWER on IntegriCloud