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

regulator: anatop-regulator: Use devm_regulator_register

devm_* simplifies the code.
Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Acked-by: default avatarMarek Vasut <marex@denx.de>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 8d491bf4
......@@ -200,7 +200,7 @@ static int anatop_regulator_probe(struct platform_device *pdev)
config.regmap = sreg->anatop;
/* register regulator */
rdev = regulator_register(rdesc, &config);
rdev = devm_regulator_register(dev, rdesc, &config);
if (IS_ERR(rdev)) {
dev_err(dev, "failed to register %s\n",
rdesc->name);
......@@ -223,7 +223,6 @@ static int anatop_regulator_remove(struct platform_device *pdev)
struct anatop_regulator *sreg = rdev_get_drvdata(rdev);
const char *name = sreg->name;
regulator_unregister(rdev);
kfree(name);
return 0;
......
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