diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-04-24 22:04:58 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-05-09 11:51:26 -0400 |
commit | 1d88f7a01d9588b3298cfd6a2ec30538e96d166e (patch) | |
tree | 413c450cfcf65b0eb6f0ca06b24030847049a19c | |
parent | 1092e1c761dd0dc92a431085e322956d91d057a6 (diff) |
mfd: Convert tps65090 to devm_regmap_init_i2c()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r-- | drivers/mfd/tps65090.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/mfd/tps65090.c b/drivers/mfd/tps65090.c index d9940870a688..9ca4c44dfc62 100644 --- a/drivers/mfd/tps65090.c +++ b/drivers/mfd/tps65090.c | |||
@@ -294,8 +294,8 @@ static int __devinit tps65090_i2c_probe(struct i2c_client *client, | |||
294 | } | 294 | } |
295 | } | 295 | } |
296 | 296 | ||
297 | tps65090->rmap = regmap_init_i2c(tps65090->client, | 297 | tps65090->rmap = devm_regmap_init_i2c(tps65090->client, |
298 | &tps65090_regmap_config); | 298 | &tps65090_regmap_config); |
299 | if (IS_ERR(tps65090->rmap)) { | 299 | if (IS_ERR(tps65090->rmap)) { |
300 | ret = PTR_ERR(tps65090->rmap); | 300 | ret = PTR_ERR(tps65090->rmap); |
301 | dev_err(&client->dev, "regmap_init failed with err: %d\n", ret); | 301 | dev_err(&client->dev, "regmap_init failed with err: %d\n", ret); |
@@ -307,14 +307,11 @@ static int __devinit tps65090_i2c_probe(struct i2c_client *client, | |||
307 | if (ret) { | 307 | if (ret) { |
308 | dev_err(&client->dev, "add mfd devices failed with err: %d\n", | 308 | dev_err(&client->dev, "add mfd devices failed with err: %d\n", |
309 | ret); | 309 | ret); |
310 | goto err_regmap_exit; | 310 | goto err_irq_exit; |
311 | } | 311 | } |
312 | 312 | ||
313 | return 0; | 313 | return 0; |
314 | 314 | ||
315 | err_regmap_exit: | ||
316 | regmap_exit(tps65090->rmap); | ||
317 | |||
318 | err_irq_exit: | 315 | err_irq_exit: |
319 | if (client->irq) | 316 | if (client->irq) |
320 | free_irq(client->irq, tps65090); | 317 | free_irq(client->irq, tps65090); |
@@ -327,7 +324,6 @@ static int __devexit tps65090_i2c_remove(struct i2c_client *client) | |||
327 | struct tps65090 *tps65090 = i2c_get_clientdata(client); | 324 | struct tps65090 *tps65090 = i2c_get_clientdata(client); |
328 | 325 | ||
329 | mfd_remove_devices(tps65090->dev); | 326 | mfd_remove_devices(tps65090->dev); |
330 | regmap_exit(tps65090->rmap); | ||
331 | if (client->irq) | 327 | if (client->irq) |
332 | free_irq(client->irq, tps65090); | 328 | free_irq(client->irq, tps65090); |
333 | 329 | ||