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>
This commit is contained in:
Sachin Kamat 2013-09-04 17:17:45 +05:30 committed by Mark Brown
parent 1084081dc8
commit 58c6e938c0

View file

@ -476,7 +476,7 @@ static int tps62360_probe(struct i2c_client *client,
config.of_node = client->dev.of_node; config.of_node = client->dev.of_node;
/* Register the regulators */ /* Register the regulators */
rdev = regulator_register(&tps->desc, &config); rdev = devm_regulator_register(&client->dev, &tps->desc, &config);
if (IS_ERR(rdev)) { if (IS_ERR(rdev)) {
dev_err(tps->dev, dev_err(tps->dev,
"%s(): regulator register failed with err %s\n", "%s(): regulator register failed with err %s\n",
@ -488,20 +488,6 @@ static int tps62360_probe(struct i2c_client *client,
return 0; return 0;
} }
/**
* tps62360_remove - tps62360 driver i2c remove handler
* @client: i2c driver client device structure
*
* Unregister TPS driver as an i2c client device driver
*/
static int tps62360_remove(struct i2c_client *client)
{
struct tps62360_chip *tps = i2c_get_clientdata(client);
regulator_unregister(tps->rdev);
return 0;
}
static void tps62360_shutdown(struct i2c_client *client) static void tps62360_shutdown(struct i2c_client *client)
{ {
struct tps62360_chip *tps = i2c_get_clientdata(client); struct tps62360_chip *tps = i2c_get_clientdata(client);
@ -535,7 +521,6 @@ static struct i2c_driver tps62360_i2c_driver = {
.of_match_table = of_match_ptr(tps62360_of_match), .of_match_table = of_match_ptr(tps62360_of_match),
}, },
.probe = tps62360_probe, .probe = tps62360_probe,
.remove = tps62360_remove,
.shutdown = tps62360_shutdown, .shutdown = tps62360_shutdown,
.id_table = tps62360_id, .id_table = tps62360_id,
}; };