[v3,1/2] media: imx-media-csi: Fix inconsistent IS_ERR and PTR_ERR

Message ID 1520081790-3437-1-git-send-email-festevam@gmail.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Fabio Estevam March 3, 2018, 12:56 p.m. UTC
  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 v2:
- None
Changes since v1:
- None

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

Comments

Philipp Zabel April 16, 2018, 1:16 p.m. UTC | #1
Hi,

On Sat, 2018-03-03 at 09:56 -0300, Fabio Estevam wrote:
> 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 v2:
> - None
> Changes since v1:
> - None
> 
>  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 5a195f8..4f290a0 100644
> --- a/drivers/staging/media/imx/imx-media-csi.c
> +++ b/drivers/staging/media/imx/imx-media-csi.c
> @@ -1798,7 +1798,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);

The second patch is applied now, but this part is still missing in
v4.17-rc1, causing the CSI subdev probe to fail:

  imx-ipuv3-csi: probe of imx-ipuv3-csi.0 failed with error -1369528304
  imx-ipuv3-csi: probe of imx-ipuv3-csi.1 failed with error -1369528304
  imx-ipuv3-csi: probe of imx-ipuv3-csi.5 failed with error -1369528304
  imx-ipuv3-csi: probe of imx-ipuv3-csi.6 failed with error -1369528304

regards
Philipp
  
Fabio Estevam April 16, 2018, 5:32 p.m. UTC | #2
On Mon, Apr 16, 2018 at 10:16 AM, Philipp Zabel <p.zabel@pengutronix.de> wrote:

> The second patch is applied now, but this part is still missing in
> v4.17-rc1, causing the CSI subdev probe to fail:
>
>   imx-ipuv3-csi: probe of imx-ipuv3-csi.0 failed with error -1369528304
>   imx-ipuv3-csi: probe of imx-ipuv3-csi.1 failed with error -1369528304
>   imx-ipuv3-csi: probe of imx-ipuv3-csi.5 failed with error -1369528304
>   imx-ipuv3-csi: probe of imx-ipuv3-csi.6 failed with error -1369528304

Yes, this original patch does not apply against 4.17-rc1 anymore, so I
rebased and resend it.

Thanks
  

Patch

diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c
index 5a195f8..4f290a0 100644
--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -1798,7 +1798,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);
 		goto free;
 	}