mirror of https://gitee.com/openkylin/linux.git
[media] s5p-tv: Use devm_regulator_get() in sdo_drv.c file
devm_regulator_get() is a device managed function and makes the exit code a bit simpler and cleaner. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
d1bb4b29a7
commit
00d98c1bd6
|
@ -374,15 +374,15 @@ static int __devinit sdo_probe(struct platform_device *pdev)
|
||||||
dev_info(dev, "fout_vpll.rate = %lu\n", clk_get_rate(sclk_vpll));
|
dev_info(dev, "fout_vpll.rate = %lu\n", clk_get_rate(sclk_vpll));
|
||||||
|
|
||||||
/* acquire regulator */
|
/* acquire regulator */
|
||||||
sdev->vdac = regulator_get(dev, "vdd33a_dac");
|
sdev->vdac = devm_regulator_get(dev, "vdd33a_dac");
|
||||||
if (IS_ERR_OR_NULL(sdev->vdac)) {
|
if (IS_ERR_OR_NULL(sdev->vdac)) {
|
||||||
dev_err(dev, "failed to get regulator 'vdac'\n");
|
dev_err(dev, "failed to get regulator 'vdac'\n");
|
||||||
goto fail_fout_vpll;
|
goto fail_fout_vpll;
|
||||||
}
|
}
|
||||||
sdev->vdet = regulator_get(dev, "vdet");
|
sdev->vdet = devm_regulator_get(dev, "vdet");
|
||||||
if (IS_ERR_OR_NULL(sdev->vdet)) {
|
if (IS_ERR_OR_NULL(sdev->vdet)) {
|
||||||
dev_err(dev, "failed to get regulator 'vdet'\n");
|
dev_err(dev, "failed to get regulator 'vdet'\n");
|
||||||
goto fail_vdac;
|
goto fail_fout_vpll;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* enable gate for dac clock, because mixer uses it */
|
/* enable gate for dac clock, because mixer uses it */
|
||||||
|
@ -406,8 +406,6 @@ static int __devinit sdo_probe(struct platform_device *pdev)
|
||||||
dev_info(dev, "probe succeeded\n");
|
dev_info(dev, "probe succeeded\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail_vdac:
|
|
||||||
regulator_put(sdev->vdac);
|
|
||||||
fail_fout_vpll:
|
fail_fout_vpll:
|
||||||
clk_put(sdev->fout_vpll);
|
clk_put(sdev->fout_vpll);
|
||||||
fail_dacphy:
|
fail_dacphy:
|
||||||
|
@ -428,8 +426,6 @@ static int __devexit sdo_remove(struct platform_device *pdev)
|
||||||
|
|
||||||
pm_runtime_disable(&pdev->dev);
|
pm_runtime_disable(&pdev->dev);
|
||||||
clk_disable(sdev->dac);
|
clk_disable(sdev->dac);
|
||||||
regulator_put(sdev->vdet);
|
|
||||||
regulator_put(sdev->vdac);
|
|
||||||
clk_put(sdev->fout_vpll);
|
clk_put(sdev->fout_vpll);
|
||||||
clk_put(sdev->dacphy);
|
clk_put(sdev->dacphy);
|
||||||
clk_put(sdev->dac);
|
clk_put(sdev->dac);
|
||||||
|
|
Loading…
Reference in New Issue