Skip to content

Commit

Permalink
media: imx-pxp: Improve pxp_soft_reset() error message
Browse files Browse the repository at this point in the history
Improve the pxp_soft_reset() error message by moving it to the
caller function, associating it with a proper device and also
by displaying the error code.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
  • Loading branch information
Fabio Estevam authored and Mauro Carvalho Chehab committed Nov 23, 2018
1 parent e03eb36 commit 3431ebe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/media/platform/imx-pxp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1619,10 +1619,8 @@ static int pxp_soft_reset(struct pxp_dev *dev)

ret = readl_poll_timeout(dev->mmio + HW_PXP_CTRL, val,
val & BM_PXP_CTRL_CLKGATE, 0, 100);
if (ret < 0) {
pr_err("PXP reset timeout\n");
if (ret < 0)
return ret;
}

writel(BM_PXP_CTRL_SFTRST, dev->mmio + HW_PXP_CTRL_CLR);
writel(BM_PXP_CTRL_CLKGATE, dev->mmio + HW_PXP_CTRL_CLR);
Expand Down Expand Up @@ -1675,8 +1673,10 @@ static int pxp_probe(struct platform_device *pdev)
return ret;

ret = pxp_soft_reset(dev);
if (ret < 0)
if (ret < 0) {
dev_err(&pdev->dev, "PXP reset timeout: %d\n", ret);
goto err_clk;
}

spin_lock_init(&dev->irqlock);

Expand Down

0 comments on commit 3431ebe

Please sign in to comment.