Skip to contentSkip to conversation

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

PATCH In review Fabio Estevam 3 participants 7 messages Mar 3, 2018 – Apr 16, 2018

Subsystems (4)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

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

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 v2:
- None
Changes since v1:
- None

 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 5a195f8..4f290a0 100644
@@ -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;
 	}
 
Signature · 1 line
2.7.4
author reviewer
#1 lore raw

PATCH v3 2/2 media: imx-media-csi: Do not propagate the error when pinctrl is not found

From: Fabio Estevam <[email protected]>

Since commit 52e17089d185 ("media: imx: Don't initialize vars that won't be used") imx_csi_probe() fails to probe after propagating the devm_pinctrl_get_select_default() error.

devm_pinctrl_get_select_default() may return -ENODEV when the CSI pinctrl entry is not found, so better not to propagate the error in the -ENODEV case to avoid a regression.

---
Changes since v2:
- Remove extraneous 'drivers/staging/media/imx/imx-media-csi.c' in commit log Changes since v1:
- Add \n to the dbg message

 drivers/staging/media/imx/imx-media-csi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/staging/media/imx/imx-media-csi.c +4 -1
index 4f290a0..5af66f6 100644
@@ -1799,7 +1799,10 @@ static int imx_csi_probe(struct platform_device *pdev)
 	pinctrl = devm_pinctrl_get_select_default(priv->dev);
 	if (IS_ERR(pinctrl)) {
 		ret = PTR_ERR(pinctrl);
-		goto free;
+		dev_dbg(priv->dev,
+			"devm_pinctrl_get_select_default() failed: %d\n", ret);
+		if (ret != -ENODEV)
+			goto free;
 	}
 
 	ret = v4l2_async_register_subdev(&priv->sd);
Signature · 1 line
2.7.4
author reviewer
#2 lore raw

Re: [PATCH v3 2/2] media: imx-media-csi: Do not propagate the error when pinctrl is not found

Hi,

Quoted 6 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Since commit 52e17089d185 ("media: imx: Don't initialize vars that won't be used") imx_csi_probe() fails to probe after propagating the devm_pinctrl_get_select_default() error.

Quoted 7 lines

devm_pinctrl_get_select_default() may return -ENODEV when the CSI pinctrl entry is not found, so better not to propagate the error in the -ENODEV case to avoid a regression.

A gentle ping.

This series fixes a regression on the imx-media-csi driver.

Thanks

author reviewer
#3 lore raw

Re: [PATCH v3 2/2] media: imx-media-csi: Do not propagate the error when pinctrl is not found

Hi Mauro and Hans,

Quoted 13 lines · Fabio Estevam

Hi,

Quoted 10 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Since commit 52e17089d185 ("media: imx: Don't initialize vars that won't be used") imx_csi_probe() fails to probe after propagating the devm_pinctrl_get_select_default() error.

devm_pinctrl_get_select_default() may return -ENODEV when the CSI pinctrl entry is not found, so better not to propagate the error in the -ENODEV case to avoid a regression.

Quoted 7 lines
Quoted 3 lines

A gentle ping.

This series fixes a regression on the imx-media-csi driver.

Could you please consider applying this series that fixes the probe of the imx-media-csi driver?

Thanks

#4 lore raw

Re: [PATCH v3 2/2] media: imx-media-csi: Do not propagate the error when pinctrl is not found

Quoted 20 lines · Fabio Estevam

Hi Mauro and Hans,

Quoted 17 lines · Fabio Estevam

Hi,

Quoted 13 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Since commit 52e17089d185 ("media: imx: Don't initialize vars that won't be used") imx_csi_probe() fails to probe after propagating the devm_pinctrl_get_select_default() error.

devm_pinctrl_get_select_default() may return -ENODEV when the CSI pinctrl entry is not found, so better not to propagate the error in the -ENODEV case to avoid a regression.

Quoted 6 lines
Quoted 3 lines

A gentle ping.

This series fixes a regression on the imx-media-csi driver.

Could you please consider applying this series that fixes the probe of the imx-media-csi driver?

It's delegated to Sakari.

Sakari, if you're busy then just let me know and I can take it.

Regards,

Hans

maintainer
#5 lore raw
In reply to Fabio Estevam

Hi,

Quoted 26 lines · Fabio Estevam

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 v2:
- None
Changes since v1:
- None

 drivers/staging/media/imx/imx-media-csi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/imx/imx-media-csi.c +0 -0
index 5a195f8..4f290a0 100644

drivers/staging/media/imx/imx-media-csi.c static int imx_csi_probe(struct platform_device *pdev) · line 1801

Quoted 5 lines
drivers/staging/media/imx/imx-media-csi.c +1 -1
@@ -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

author reviewer
#6 lore raw
Quoted 7 lines · Philipp Zabel

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