Skip to contentSkip to conversation

media: imx-media-csi: Fix inconsistent IS_ERR and PTR_ERR

PATCH In review Fabio Estevam 2 participants 3 messages Apr 16, 2018 – Apr 23, 2018

Subsystems (4)

v2 of 3 In review Latest is v3 →

lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH v2 1/1 media: imx-media-csi: Fix inconsistent IS_ERR and PTR_ERR

From: From: Gustavo A. R. Silva <[email protected]>

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")

---
Changes since v1:
- Rebased against 4.17-rc1

 drivers/staging/media/imx/imx-media-csi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/imx/imx-media-csi.c +1 -1
index 16cab40..aeab05f 100644
@@ -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)
Signature · 1 line
2.7.4
author reviewer
#1 lore raw

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

Quoted 35 lines · Fabio Estevam

From: From: Gustavo A. R. Silva <[email protected]>

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")

---
Changes since v1:
- Rebased against 4.17-rc1

 drivers/staging/media/imx/imx-media-csi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/imx/imx-media-csi.c +1 -2
index 16cab40..aeab05f 100644
@@ -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

maintainer Reviewed-by Tested-by
#2 lore raw
Quoted 22 lines · Fabio Estevam

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

Quoted 12 lines · Fabio Estevam

From: From: Gustavo A. R. Silva <[email protected]>

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")

regards
Philipp