diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-09-04 07:47:45 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-16 19:28:43 -0400 |
commit | 58c6e938c00de744d52f739aa426a4b1b13ef22b (patch) | |
tree | b98d6079b7e3d3a7bc3e7579923af0e14207caf4 | |
parent | 1084081dc8e5556e91539de082eaae89e39516c9 (diff) |
regulator: tps62360: 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>
-rw-r--r-- | drivers/regulator/tps62360-regulator.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/regulator/tps62360-regulator.c b/drivers/regulator/tps62360-regulator.c index 0b7ebb1ebf85..c2c0185a2dcd 100644 --- a/drivers/regulator/tps62360-regulator.c +++ b/drivers/regulator/tps62360-regulator.c | |||
@@ -476,7 +476,7 @@ static int tps62360_probe(struct i2c_client *client, | |||
476 | config.of_node = client->dev.of_node; | 476 | config.of_node = client->dev.of_node; |
477 | 477 | ||
478 | /* Register the regulators */ | 478 | /* Register the regulators */ |
479 | rdev = regulator_register(&tps->desc, &config); | 479 | rdev = devm_regulator_register(&client->dev, &tps->desc, &config); |
480 | if (IS_ERR(rdev)) { | 480 | if (IS_ERR(rdev)) { |
481 | dev_err(tps->dev, | 481 | dev_err(tps->dev, |
482 | "%s(): regulator register failed with err %s\n", | 482 | "%s(): regulator register failed with err %s\n", |
@@ -488,20 +488,6 @@ static int tps62360_probe(struct i2c_client *client, | |||
488 | return 0; | 488 | return 0; |
489 | } | 489 | } |
490 | 490 | ||
491 | /** | ||
492 | * tps62360_remove - tps62360 driver i2c remove handler | ||
493 | * @client: i2c driver client device structure | ||
494 | * | ||
495 | * Unregister TPS driver as an i2c client device driver | ||
496 | */ | ||
497 | static int tps62360_remove(struct i2c_client *client) | ||
498 | { | ||
499 | struct tps62360_chip *tps = i2c_get_clientdata(client); | ||
500 | |||
501 | regulator_unregister(tps->rdev); | ||
502 | return 0; | ||
503 | } | ||
504 | |||
505 | static void tps62360_shutdown(struct i2c_client *client) | 491 | static void tps62360_shutdown(struct i2c_client *client) |
506 | { | 492 | { |
507 | struct tps62360_chip *tps = i2c_get_clientdata(client); | 493 | struct tps62360_chip *tps = i2c_get_clientdata(client); |
@@ -535,7 +521,6 @@ static struct i2c_driver tps62360_i2c_driver = { | |||
535 | .of_match_table = of_match_ptr(tps62360_of_match), | 521 | .of_match_table = of_match_ptr(tps62360_of_match), |
536 | }, | 522 | }, |
537 | .probe = tps62360_probe, | 523 | .probe = tps62360_probe, |
538 | .remove = tps62360_remove, | ||
539 | .shutdown = tps62360_shutdown, | 524 | .shutdown = tps62360_shutdown, |
540 | .id_table = tps62360_id, | 525 | .id_table = tps62360_id, |
541 | }; | 526 | }; |