diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2016-09-14 23:21:45 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-09-19 14:17:50 -0300 |
commit | a2755e1178c33e69a8c0f7a9961d52ce4af8d365 (patch) | |
tree | 9666cd9c9b693b0f6f0d7a1cd168a33c43166c97 /drivers/media/platform | |
parent | e4011b69ab329cc0d238d4dc530ab870c566c566 (diff) | |
download | talos-obmc-linux-a2755e1178c33e69a8c0f7a9961d52ce4af8d365.tar.gz talos-obmc-linux-a2755e1178c33e69a8c0f7a9961d52ce4af8d365.zip |
[media] pxa_camera: fix error return code in pxa_camera_probe()
Fix to return error code -ENODEV from dma_request_slave_channel_compat()
error handling case instead of 0, as done elsewhere in this function.
Also fix to release resources in v4l2_clk_register() error handling.
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/pxa_camera.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/platform/pxa_camera.c b/drivers/media/platform/pxa_camera.c index 23c8780b3b0f..f795100854e4 100644 --- a/drivers/media/platform/pxa_camera.c +++ b/drivers/media/platform/pxa_camera.c @@ -2402,6 +2402,7 @@ static int pxa_camera_probe(struct platform_device *pdev) ¶ms, &pdev->dev, "CI_U"); if (!pcdev->dma_chans[1]) { dev_err(&pdev->dev, "Can't request DMA for Y\n"); + err = -ENODEV; goto exit_free_dma_y; } @@ -2411,6 +2412,7 @@ static int pxa_camera_probe(struct platform_device *pdev) ¶ms, &pdev->dev, "CI_V"); if (!pcdev->dma_chans[2]) { dev_err(&pdev->dev, "Can't request DMA for V\n"); + err = -ENODEV; goto exit_free_dma_u; } @@ -2461,8 +2463,10 @@ static int pxa_camera_probe(struct platform_device *pdev) pcdev->mclk_clk = v4l2_clk_register(&pxa_camera_mclk_ops, clk_name, NULL); - if (IS_ERR(pcdev->mclk_clk)) - return PTR_ERR(pcdev->mclk_clk); + if (IS_ERR(pcdev->mclk_clk)) { + err = PTR_ERR(pcdev->mclk_clk); + goto exit_free_v4l2dev; + } } err = v4l2_async_notifier_register(&pcdev->v4l2_dev, &pcdev->notifier); |