regulator: anatop-regulator: Use devm_regulator_register
devm_* simplifies the code. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
8d491bf42e
commit
be1221e893
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue