mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
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>
This commit is contained in:
parent
2429d86386
commit
b30dd8f2e5
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user