Commit 11c0da7b authored by Jingoo Han's avatar Jingoo Han Committed by Mark Brown

regulator: da9210: use devm_regulator_register()

Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 21a122b5
...@@ -155,7 +155,7 @@ static int da9210_i2c_probe(struct i2c_client *i2c, ...@@ -155,7 +155,7 @@ static int da9210_i2c_probe(struct i2c_client *i2c,
config.regmap = chip->regmap; config.regmap = chip->regmap;
config.of_node = dev->of_node; config.of_node = dev->of_node;
rdev = regulator_register(&da9210_reg, &config); rdev = devm_regulator_register(&i2c->dev, &da9210_reg, &config);
if (IS_ERR(rdev)) { if (IS_ERR(rdev)) {
dev_err(&i2c->dev, "Failed to register DA9210 regulator\n"); dev_err(&i2c->dev, "Failed to register DA9210 regulator\n");
return PTR_ERR(rdev); return PTR_ERR(rdev);
...@@ -168,13 +168,6 @@ static int da9210_i2c_probe(struct i2c_client *i2c, ...@@ -168,13 +168,6 @@ static int da9210_i2c_probe(struct i2c_client *i2c,
return 0; return 0;
} }
static int da9210_i2c_remove(struct i2c_client *i2c)
{
struct da9210 *chip = i2c_get_clientdata(i2c);
regulator_unregister(chip->rdev);
return 0;
}
static const struct i2c_device_id da9210_i2c_id[] = { static const struct i2c_device_id da9210_i2c_id[] = {
{"da9210", 0}, {"da9210", 0},
{}, {},
...@@ -188,7 +181,6 @@ static struct i2c_driver da9210_regulator_driver = { ...@@ -188,7 +181,6 @@ static struct i2c_driver da9210_regulator_driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, },
.probe = da9210_i2c_probe, .probe = da9210_i2c_probe,
.remove = da9210_i2c_remove,
.id_table = da9210_i2c_id, .id_table = da9210_i2c_id,
}; };
......
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