Skip to content

Commit

Permalink
media: driver/nxp/imx-jpeg: fix a unexpected return value problem
Browse files Browse the repository at this point in the history
In function mxc_jpeg_probe(), when devm_clk_get() fail, the return value
will be unexpected, and it should be the devm_clk_get's error code.

Fixes: 4c2e515 ("media: imx-jpeg: Add pm-runtime support for imx-jpeg")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Jian Zhang <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
Jian Zhang authored and mchehab committed Jun 27, 2022
1 parent a340c85 commit 5b30404
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2205,12 +2205,14 @@ static int mxc_jpeg_probe(struct platform_device *pdev)
jpeg->clk_ipg = devm_clk_get(dev, "ipg");
if (IS_ERR(jpeg->clk_ipg)) {
dev_err(dev, "failed to get clock: ipg\n");
ret = PTR_ERR(jpeg->clk_ipg);
goto err_clk;
}

jpeg->clk_per = devm_clk_get(dev, "per");
if (IS_ERR(jpeg->clk_per)) {
dev_err(dev, "failed to get clock: per\n");
ret = PTR_ERR(jpeg->clk_per);
goto err_clk;
}

Expand Down

0 comments on commit 5b30404

Please sign in to comment.