Commit b30dd8f2 authored by Axel Lin's avatar Axel Lin Committed by Samuel Ortiz

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: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 2429d863
...@@ -208,6 +208,8 @@ static int pcf50633_probe(struct i2c_client *client, ...@@ -208,6 +208,8 @@ static int pcf50633_probe(struct i2c_client *client,
if (!pcf) if (!pcf)
return -ENOMEM; return -ENOMEM;
i2c_set_clientdata(client, pcf);
pcf->dev = &client->dev;
pcf->pdata = pdata; pcf->pdata = pdata;
mutex_init(&pcf->lock); mutex_init(&pcf->lock);
...@@ -219,9 +221,6 @@ static int pcf50633_probe(struct i2c_client *client, ...@@ -219,9 +221,6 @@ static int pcf50633_probe(struct i2c_client *client,
return ret; return ret;
} }
i2c_set_clientdata(client, pcf);
pcf->dev = &client->dev;
version = pcf50633_reg_read(pcf, 0); version = pcf50633_reg_read(pcf, 0);
variant = pcf50633_reg_read(pcf, 1); variant = pcf50633_reg_read(pcf, 1);
if (version < 0 || variant < 0) { if (version < 0 || variant < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment