Skip to content

Commit

Permalink
mfd: pcf50633: Init pcf->dev before using it
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Samuel Ortiz committed Jan 22, 2013
1 parent 2429d86 commit b30dd8f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/mfd/pcf50633-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down

0 comments on commit b30dd8f

Please sign in to comment.