diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-09-04 07:47:44 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-16 19:28:42 -0400 |
commit | 1084081dc8e5556e91539de082eaae89e39516c9 (patch) | |
tree | b0fea24bd220750aea78a7ab0bc55cbd59871cc1 /drivers/regulator/tps51632-regulator.c | |
parent | 91dfc80d84eee076a835fb34d053618e63667370 (diff) |
regulator: tps51632: Use devm_regulator_register
devm_* simplifies the code.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/tps51632-regulator.c')
-rw-r--r-- | drivers/regulator/tps51632-regulator.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/regulator/tps51632-regulator.c b/drivers/regulator/tps51632-regulator.c index 9392a7ca3d2d..b0a3f0917a27 100644 --- a/drivers/regulator/tps51632-regulator.c +++ b/drivers/regulator/tps51632-regulator.c | |||
@@ -343,7 +343,7 @@ static int tps51632_probe(struct i2c_client *client, | |||
343 | config.regmap = tps->regmap; | 343 | config.regmap = tps->regmap; |
344 | config.of_node = client->dev.of_node; | 344 | config.of_node = client->dev.of_node; |
345 | 345 | ||
346 | rdev = regulator_register(&tps->desc, &config); | 346 | rdev = devm_regulator_register(&client->dev, &tps->desc, &config); |
347 | if (IS_ERR(rdev)) { | 347 | if (IS_ERR(rdev)) { |
348 | dev_err(tps->dev, "regulator register failed\n"); | 348 | dev_err(tps->dev, "regulator register failed\n"); |
349 | return PTR_ERR(rdev); | 349 | return PTR_ERR(rdev); |
@@ -353,14 +353,6 @@ static int tps51632_probe(struct i2c_client *client, | |||
353 | return 0; | 353 | return 0; |
354 | } | 354 | } |
355 | 355 | ||
356 | static int tps51632_remove(struct i2c_client *client) | ||
357 | { | ||
358 | struct tps51632_chip *tps = i2c_get_clientdata(client); | ||
359 | |||
360 | regulator_unregister(tps->rdev); | ||
361 | return 0; | ||
362 | } | ||
363 | |||
364 | static const struct i2c_device_id tps51632_id[] = { | 356 | static const struct i2c_device_id tps51632_id[] = { |
365 | {.name = "tps51632",}, | 357 | {.name = "tps51632",}, |
366 | {}, | 358 | {}, |
@@ -375,7 +367,6 @@ static struct i2c_driver tps51632_i2c_driver = { | |||
375 | .of_match_table = of_match_ptr(tps51632_of_match), | 367 | .of_match_table = of_match_ptr(tps51632_of_match), |
376 | }, | 368 | }, |
377 | .probe = tps51632_probe, | 369 | .probe = tps51632_probe, |
378 | .remove = tps51632_remove, | ||
379 | .id_table = tps51632_id, | 370 | .id_table = tps51632_id, |
380 | }; | 371 | }; |
381 | 372 | ||