提交 b30dd8f2 编写于 作者: A Axel Lin 提交者: 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: NAxel Lin <axel.lin@ingics.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 2429d863
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册