mirror of
https://github.com/torvalds/linux.git
synced 2024-12-29 06:12:08 +00:00
[media] s5p-tv: Fix return value in sdo_probe() on error paths
Use proper return value test for clk_get() and devm_regulator_get() functions and propagate any errors from the clock and the regulator subsystem to the driver core. In two cases a proper error code is now returned rather than 0. Reported-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
740ad921f8
commit
cf48f56c27
@ -341,47 +341,50 @@ static int __devinit sdo_probe(struct platform_device *pdev)
|
||||
|
||||
/* acquire clocks */
|
||||
sdev->sclk_dac = clk_get(dev, "sclk_dac");
|
||||
if (IS_ERR_OR_NULL(sdev->sclk_dac)) {
|
||||
if (IS_ERR(sdev->sclk_dac)) {
|
||||
dev_err(dev, "failed to get clock 'sclk_dac'\n");
|
||||
ret = -ENXIO;
|
||||
ret = PTR_ERR(sdev->sclk_dac);
|
||||
goto fail;
|
||||
}
|
||||
sdev->dac = clk_get(dev, "dac");
|
||||
if (IS_ERR_OR_NULL(sdev->dac)) {
|
||||
if (IS_ERR(sdev->dac)) {
|
||||
dev_err(dev, "failed to get clock 'dac'\n");
|
||||
ret = -ENXIO;
|
||||
ret = PTR_ERR(sdev->dac);
|
||||
goto fail_sclk_dac;
|
||||
}
|
||||
sdev->dacphy = clk_get(dev, "dacphy");
|
||||
if (IS_ERR_OR_NULL(sdev->dacphy)) {
|
||||
if (IS_ERR(sdev->dacphy)) {
|
||||
dev_err(dev, "failed to get clock 'dacphy'\n");
|
||||
ret = -ENXIO;
|
||||
ret = PTR_ERR(sdev->dacphy);
|
||||
goto fail_dac;
|
||||
}
|
||||
sclk_vpll = clk_get(dev, "sclk_vpll");
|
||||
if (IS_ERR_OR_NULL(sclk_vpll)) {
|
||||
if (IS_ERR(sclk_vpll)) {
|
||||
dev_err(dev, "failed to get clock 'sclk_vpll'\n");
|
||||
ret = -ENXIO;
|
||||
ret = PTR_ERR(sclk_vpll);
|
||||
goto fail_dacphy;
|
||||
}
|
||||
clk_set_parent(sdev->sclk_dac, sclk_vpll);
|
||||
clk_put(sclk_vpll);
|
||||
sdev->fout_vpll = clk_get(dev, "fout_vpll");
|
||||
if (IS_ERR_OR_NULL(sdev->fout_vpll)) {
|
||||
if (IS_ERR(sdev->fout_vpll)) {
|
||||
dev_err(dev, "failed to get clock 'fout_vpll'\n");
|
||||
ret = PTR_ERR(sdev->fout_vpll);
|
||||
goto fail_dacphy;
|
||||
}
|
||||
dev_info(dev, "fout_vpll.rate = %lu\n", clk_get_rate(sclk_vpll));
|
||||
|
||||
/* acquire regulator */
|
||||
sdev->vdac = devm_regulator_get(dev, "vdd33a_dac");
|
||||
if (IS_ERR_OR_NULL(sdev->vdac)) {
|
||||
if (IS_ERR(sdev->vdac)) {
|
||||
dev_err(dev, "failed to get regulator 'vdac'\n");
|
||||
ret = PTR_ERR(sdev->vdac);
|
||||
goto fail_fout_vpll;
|
||||
}
|
||||
sdev->vdet = devm_regulator_get(dev, "vdet");
|
||||
if (IS_ERR_OR_NULL(sdev->vdet)) {
|
||||
if (IS_ERR(sdev->vdet)) {
|
||||
dev_err(dev, "failed to get regulator 'vdet'\n");
|
||||
ret = PTR_ERR(sdev->vdet);
|
||||
goto fail_fout_vpll;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user