diff options
author | Axel Lin <axel.lin@ingics.com> | 2012-12-24 21:52:49 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-01-21 21:05:33 -0500 |
commit | b30dd8f2e5e6a1b31b89d93d85942055b97327c2 (patch) | |
tree | 85ba2590eb56c60765282f3559a3a7a1b7229927 | |
parent | 2429d863868edb611f033c9ce4db519fbc270240 (diff) |
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>
-rw-r--r-- | drivers/mfd/pcf50633-core.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c index 64803f13bcec..d11567307fbe 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, | |||
208 | if (!pcf) | 208 | if (!pcf) |
209 | return -ENOMEM; | 209 | return -ENOMEM; |
210 | 210 | ||
211 | i2c_set_clientdata(client, pcf); | ||
212 | pcf->dev = &client->dev; | ||
211 | pcf->pdata = pdata; | 213 | pcf->pdata = pdata; |
212 | 214 | ||
213 | mutex_init(&pcf->lock); | 215 | mutex_init(&pcf->lock); |
@@ -219,9 +221,6 @@ static int pcf50633_probe(struct i2c_client *client, | |||
219 | return ret; | 221 | return ret; |
220 | } | 222 | } |
221 | 223 | ||
222 | i2c_set_clientdata(client, pcf); | ||
223 | pcf->dev = &client->dev; | ||
224 | |||
225 | version = pcf50633_reg_read(pcf, 0); | 224 | version = pcf50633_reg_read(pcf, 0); |
226 | variant = pcf50633_reg_read(pcf, 1); | 225 | variant = pcf50633_reg_read(pcf, 1); |
227 | if (version < 0 || variant < 0) { | 226 | if (version < 0 || variant < 0) { |