aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/wm8400-core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-30 16:18:01 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-22 08:57:05 -0500
commit2b40e9d97d196f98ef356003d400d5675174b4fc (patch)
treed904d7a6c68805c801c78ef0a012a9bf5ff4e89a /drivers/mfd/wm8400-core.c
parent130a70323c323046b15a76ef1147b1fe700afd10 (diff)
mfd: wm8400: Convert to devm_regmap_init_i2c()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/wm8400-core.c')
-rw-r--r--drivers/mfd/wm8400-core.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c
index 2204893444a..237764ae5f9 100644
--- a/drivers/mfd/wm8400-core.c
+++ b/drivers/mfd/wm8400-core.c
@@ -350,7 +350,7 @@ static int wm8400_i2c_probe(struct i2c_client *i2c,
350 goto err; 350 goto err;
351 } 351 }
352 352
353 wm8400->regmap = regmap_init_i2c(i2c, &wm8400_regmap_config); 353 wm8400->regmap = devm_regmap_init_i2c(i2c, &wm8400_regmap_config);
354 if (IS_ERR(wm8400->regmap)) { 354 if (IS_ERR(wm8400->regmap)) {
355 ret = PTR_ERR(wm8400->regmap); 355 ret = PTR_ERR(wm8400->regmap);
356 goto err; 356 goto err;
@@ -361,12 +361,10 @@ static int wm8400_i2c_probe(struct i2c_client *i2c,
361 361
362 ret = wm8400_init(wm8400, i2c->dev.platform_data); 362 ret = wm8400_init(wm8400, i2c->dev.platform_data);
363 if (ret != 0) 363 if (ret != 0)
364 goto map_err; 364 goto err;
365 365
366 return 0; 366 return 0;
367 367
368map_err:
369 regmap_exit(wm8400->regmap);
370err: 368err:
371 return ret; 369 return ret;
372} 370}
@@ -376,7 +374,6 @@ static int wm8400_i2c_remove(struct i2c_client *i2c)
376 struct wm8400 *wm8400 = i2c_get_clientdata(i2c); 374 struct wm8400 *wm8400 = i2c_get_clientdata(i2c);
377 375
378 wm8400_release(wm8400); 376 wm8400_release(wm8400);
379 regmap_exit(wm8400->regmap);
380 377
381 return 0; 378 return 0;
382} 379}