You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
@@ -343,7 +343,7 @@ static int tps51632_probe(struct i2c_client *client,
|
|||||||
config.regmap = tps->regmap;
|
config.regmap = tps->regmap;
|
||||||
config.of_node = client->dev.of_node;
|
config.of_node = client->dev.of_node;
|
||||||
|
|
||||||
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, "regulator register failed\n");
|
dev_err(tps->dev, "regulator register failed\n");
|
||||||
return PTR_ERR(rdev);
|
return PTR_ERR(rdev);
|
||||||
@@ -353,14 +353,6 @@ static int tps51632_probe(struct i2c_client *client,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tps51632_remove(struct i2c_client *client)
|
|
||||||
{
|
|
||||||
struct tps51632_chip *tps = i2c_get_clientdata(client);
|
|
||||||
|
|
||||||
regulator_unregister(tps->rdev);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct i2c_device_id tps51632_id[] = {
|
static const struct i2c_device_id tps51632_id[] = {
|
||||||
{.name = "tps51632",},
|
{.name = "tps51632",},
|
||||||
{},
|
{},
|
||||||
@@ -375,7 +367,6 @@ static struct i2c_driver tps51632_i2c_driver = {
|
|||||||
.of_match_table = of_match_ptr(tps51632_of_match),
|
.of_match_table = of_match_ptr(tps51632_of_match),
|
||||||
},
|
},
|
||||||
.probe = tps51632_probe,
|
.probe = tps51632_probe,
|
||||||
.remove = tps51632_remove,
|
|
||||||
.id_table = tps51632_id,
|
.id_table = tps51632_id,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user