diff mbox

[v2] media: imx-media-csi: Fix inconsistent IS_ERR and PTR_ERR

Message ID 1523899736-31360-1-git-send-email-festevam@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Fabio Estevam April 16, 2018, 5:28 p.m. UTC
From: From: Gustavo A. R. Silva <gustavo@embeddedor.com>

Fix inconsistent IS_ERR and PTR_ERR in imx_csi_probe.
The proper pointer to be passed as argument is pinctrl
instead of priv->vdev.

This issue was detected with the help of Coccinelle.

Fixes: 52e17089d185 ("media: imx: Don't initialize vars that won't be used")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
---
Changes since v1:
- Rebased against 4.17-rc1

 drivers/staging/media/imx/imx-media-csi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Fabio Estevam April 23, 2018, 11:55 a.m. UTC | #1
Hi Hans,

Unfortunately this one missed to be applied into 4.17-rc and now the
imx-media-csi driver does not probe.

Please consider applying it for 4.17-rc3 to avoid the regression.

Thanks

On Mon, Apr 16, 2018 at 2:28 PM, Fabio Estevam <festevam@gmail.com> wrote:
> From: From: Gustavo A. R. Silva <gustavo@embeddedor.com>
>
> Fix inconsistent IS_ERR and PTR_ERR in imx_csi_probe.
> The proper pointer to be passed as argument is pinctrl
> instead of priv->vdev.
>
> This issue was detected with the help of Coccinelle.
>
> Fixes: 52e17089d185 ("media: imx: Don't initialize vars that won't be used")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
> Changes since v1:
> - Rebased against 4.17-rc1
>
>  drivers/staging/media/imx/imx-media-csi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c
> index 16cab40..aeab05f 100644
> --- a/drivers/staging/media/imx/imx-media-csi.c
> +++ b/drivers/staging/media/imx/imx-media-csi.c
> @@ -1799,7 +1799,7 @@ static int imx_csi_probe(struct platform_device *pdev)
>         priv->dev->of_node = pdata->of_node;
>         pinctrl = devm_pinctrl_get_select_default(priv->dev);
>         if (IS_ERR(pinctrl)) {
> -               ret = PTR_ERR(priv->vdev);
> +               ret = PTR_ERR(pinctrl);
>                 dev_dbg(priv->dev,
>                         "devm_pinctrl_get_select_default() failed: %d\n", ret);
>                 if (ret != -ENODEV)
> --
> 2.7.4
>
Philipp Zabel April 23, 2018, 1:13 p.m. UTC | #2
On Mon, 2018-04-23 at 08:55 -0300, Fabio Estevam wrote:
> Hi Hans,
> 
> Unfortunately this one missed to be applied into 4.17-rc and now the
> imx-media-csi driver does not probe.
> 
> Please consider applying it for 4.17-rc3 to avoid the regression.
> 
> Thanks
> 
> On Mon, Apr 16, 2018 at 2:28 PM, Fabio Estevam <festevam@gmail.com> wrote:
> > From: From: Gustavo A. R. Silva <gustavo@embeddedor.com>
> > 
> > Fix inconsistent IS_ERR and PTR_ERR in imx_csi_probe.
> > The proper pointer to be passed as argument is pinctrl
> > instead of priv->vdev.
> > 
> > This issue was detected with the help of Coccinelle.
> > 
> > Fixes: 52e17089d185 ("media: imx: Don't initialize vars that won't be used")
> > Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> > Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> > Acked-by: Philipp Zabel <p.zabel@pengutronix.de>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
diff mbox

Patch

diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c
index 16cab40..aeab05f 100644
--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -1799,7 +1799,7 @@  static int imx_csi_probe(struct platform_device *pdev)
 	priv->dev->of_node = pdata->of_node;
 	pinctrl = devm_pinctrl_get_select_default(priv->dev);
 	if (IS_ERR(pinctrl)) {
-		ret = PTR_ERR(priv->vdev);
+		ret = PTR_ERR(pinctrl);
 		dev_dbg(priv->dev,
 			"devm_pinctrl_get_select_default() failed: %d\n", ret);
 		if (ret != -ENODEV)