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:
Родитель
8d491bf42e
Коммит
be1221e893
|
@ -200,7 +200,7 @@ static int anatop_regulator_probe(struct platform_device *pdev)
|
||||||
config.regmap = sreg->anatop;
|
config.regmap = sreg->anatop;
|
||||||
|
|
||||||
/* register regulator */
|
/* register regulator */
|
||||||
rdev = regulator_register(rdesc, &config);
|
rdev = devm_regulator_register(dev, rdesc, &config);
|
||||||
if (IS_ERR(rdev)) {
|
if (IS_ERR(rdev)) {
|
||||||
dev_err(dev, "failed to register %s\n",
|
dev_err(dev, "failed to register %s\n",
|
||||||
rdesc->name);
|
rdesc->name);
|
||||||
|
@ -223,7 +223,6 @@ static int anatop_regulator_remove(struct platform_device *pdev)
|
||||||
struct anatop_regulator *sreg = rdev_get_drvdata(rdev);
|
struct anatop_regulator *sreg = rdev_get_drvdata(rdev);
|
||||||
const char *name = sreg->name;
|
const char *name = sreg->name;
|
||||||
|
|
||||||
regulator_unregister(rdev);
|
|
||||||
kfree(name);
|
kfree(name);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче