Commit e453f92e authored by Sachin Kamat's avatar Sachin Kamat Committed by Mark Brown

regulator: max8649: Use devm_regulator_register

devm_* simplifies the code.
Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 027a2754
...@@ -234,7 +234,8 @@ static int max8649_regulator_probe(struct i2c_client *client, ...@@ -234,7 +234,8 @@ static int max8649_regulator_probe(struct i2c_client *client,
config.driver_data = info; config.driver_data = info;
config.regmap = info->regmap; config.regmap = info->regmap;
info->regulator = regulator_register(&dcdc_desc, &config); info->regulator = devm_regulator_register(&client->dev, &dcdc_desc,
&config);
if (IS_ERR(info->regulator)) { if (IS_ERR(info->regulator)) {
dev_err(info->dev, "failed to register regulator %s\n", dev_err(info->dev, "failed to register regulator %s\n",
dcdc_desc.name); dcdc_desc.name);
...@@ -244,16 +245,6 @@ static int max8649_regulator_probe(struct i2c_client *client, ...@@ -244,16 +245,6 @@ static int max8649_regulator_probe(struct i2c_client *client,
return 0; return 0;
} }
static int max8649_regulator_remove(struct i2c_client *client)
{
struct max8649_regulator_info *info = i2c_get_clientdata(client);
if (info)
regulator_unregister(info->regulator);
return 0;
}
static const struct i2c_device_id max8649_id[] = { static const struct i2c_device_id max8649_id[] = {
{ "max8649", 0 }, { "max8649", 0 },
{ } { }
...@@ -262,7 +253,6 @@ MODULE_DEVICE_TABLE(i2c, max8649_id); ...@@ -262,7 +253,6 @@ MODULE_DEVICE_TABLE(i2c, max8649_id);
static struct i2c_driver max8649_driver = { static struct i2c_driver max8649_driver = {
.probe = max8649_regulator_probe, .probe = max8649_regulator_probe,
.remove = max8649_regulator_remove,
.driver = { .driver = {
.name = "max8649", .name = "max8649",
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment