Skip to contentSkip to conversation

media: Switch to use dev_err_probe() helper

PATCH In review Yang Yingliang 4 participants 33 messages Sep 15, 2022 – Sep 19, 2022

Subsystems (17)
lore
Share & tools
lore
#0 lore raw

cover media: Switch to use dev_err_probe() helper

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. It will print error code in a human readable way and simplify the code.

Yang Yingliang (13):
media: platform: stm32-cec: Switch to use dev_err_probe() helper
media: i2c: ad5820: Switch to use dev_err_probe() helper
media: i2c: imx274: Switch to use dev_err_probe() helper
media: i2c: tc358743: Switch to use dev_err_probe() helper
media: platform: mtk_mdp_comp: Switch to use dev_err_probe() helper
media: platform: exynos4-is: Switch to use dev_err_probe() helper
media: stm32-dcmi: Switch to use dev_err_probe() helper
media: omap3isp: Switch to use dev_err_probe() helper
media: xilinx: csi2rxss: Switch to use dev_err_probe() helper
media: rc: gpio-ir-recv: Switch to use dev_err_probe() helper
media: rc: gpio-ir-tx: Switch to use dev_err_probe() helper
media: rc: ir-rx51: Switch to use dev_err_probe() helper
media: uvcvideo: Switch to use dev_err_probe() helper

 drivers/media/cec/platform/stm32/stm32-cec.c  |  9 +++----
 drivers/media/i2c/ad5820.c                    | 18 +++++--------
 drivers/media/i2c/imx274.c                    |  5 ++--
 drivers/media/i2c/tc358743.c                  |  9 +++----
 .../platform/mediatek/mdp/mtk_mdp_comp.c      |  5 ++--
 .../platform/samsung/exynos4-is/media-dev.c   |  4 +--
 drivers/media/platform/st/stm32/stm32-dcmi.c  | 27 +++++++------------
 drivers/media/platform/ti/omap3isp/isp.c      |  3 +--
 .../media/platform/xilinx/xilinx-csi2rxss.c   |  8 +++---
 drivers/media/rc/gpio-ir-recv.c               | 10 +++----
 drivers/media/rc/gpio-ir-tx.c                 |  9 +++----
 drivers/media/rc/ir-rx51.c                    |  9 ++-----
 drivers/media/usb/uvc/uvc_driver.c            |  9 +++----
 13 files changed, 41 insertions(+), 84 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/13 media: platform: stm32-cec: Switch to use dev_err_probe() helper

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
 drivers/media/cec/platform/stm32/stm32-cec.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/media/cec/platform/stm32/stm32-cec.c +3 -6
index 40db7911b437..7b2db46a5722 100644
@@ -288,12 +288,9 @@ static int stm32_cec_probe(struct platform_device *pdev)
 		return ret;
 
 	cec->clk_cec = devm_clk_get(&pdev->dev, "cec");
-	if (IS_ERR(cec->clk_cec)) {
-		if (PTR_ERR(cec->clk_cec) != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "Cannot get cec clock\n");
-
-		return PTR_ERR(cec->clk_cec);
-	}
+	if (IS_ERR(cec->clk_cec))
+		return dev_err_probe(&pdev->dev, PTR_ERR(cec->clk_cec),
+				     "Cannot get cec clock\n");
 
 	ret = clk_prepare(cec->clk_cec);
 	if (ret) {
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/13
#2 lore raw

Re: [PATCH -next 01/13] media: platform: stm32-cec: Switch to use dev_err_probe() helper

Hi Yang,

Thank you for the patch.

Quoted 4 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

Quoted 24 lines
---
 drivers/media/cec/platform/stm32/stm32-cec.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/media/cec/platform/stm32/stm32-cec.c +3 -6
index 40db7911b437..7b2db46a5722 100644
@@ -288,12 +288,9 @@ static int stm32_cec_probe(struct platform_device *pdev)
 		return ret;
 
 	cec->clk_cec = devm_clk_get(&pdev->dev, "cec");
-	if (IS_ERR(cec->clk_cec)) {
-		if (PTR_ERR(cec->clk_cec) != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "Cannot get cec clock\n");
-
-		return PTR_ERR(cec->clk_cec);
-	}
+	if (IS_ERR(cec->clk_cec))
+		return dev_err_probe(&pdev->dev, PTR_ERR(cec->clk_cec),
+				     "Cannot get cec clock\n");
 
 	ret = clk_prepare(cec->clk_cec);
 	if (ret) {
Signature · 3 lines
Regards,

Laurent Pinchart
#3 lore raw

PATCH 2/13 media: i2c: ad5820: Switch to use dev_err_probe() helper

In reply to Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
 drivers/media/i2c/ad5820.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)
drivers/media/i2c/ad5820.c +6 -12
index 516de278cc49..6a7f8ef9db05 100644
@@ -301,21 +301,15 @@ static int ad5820_probe(struct i2c_client *client,
 		return -ENOMEM;
 
 	coil->vana = devm_regulator_get(&client->dev, "VANA");
-	if (IS_ERR(coil->vana)) {
-		ret = PTR_ERR(coil->vana);
-		if (ret != -EPROBE_DEFER)
-			dev_err(&client->dev, "could not get regulator for vana\n");
-		return ret;
-	}
+	if (IS_ERR(coil->vana))
+		return dev_err_probe(&client->dev, PTR_ERR(coil->vana),
+				     "could not get regulator for vana\n");
 
 	coil->enable_gpio = devm_gpiod_get_optional(&client->dev, "enable",
 						    GPIOD_OUT_LOW);
-	if (IS_ERR(coil->enable_gpio)) {
-		ret = PTR_ERR(coil->enable_gpio);
-		if (ret != -EPROBE_DEFER)
-			dev_err(&client->dev, "could not get enable gpio\n");
-		return ret;
-	}
+	if (IS_ERR(coil->enable_gpio))
+		return dev_err_probe(&client->dev, PTR_ERR(coil->enable_gpio),
+				     "could not get enable gpio\n");
 
 	mutex_init(&coil->power_lock);
 
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 2/13
#4 lore raw

Re: [PATCH -next 02/13] media: i2c: ad5820: Switch to use dev_err_probe() helper

Hi Yang,

Thank you for the patch.

Quoted 4 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

Quoted 36 lines
---
 drivers/media/i2c/ad5820.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)
drivers/media/i2c/ad5820.c +6 -12
index 516de278cc49..6a7f8ef9db05 100644
@@ -301,21 +301,15 @@ static int ad5820_probe(struct i2c_client *client,
 		return -ENOMEM;
 
 	coil->vana = devm_regulator_get(&client->dev, "VANA");
-	if (IS_ERR(coil->vana)) {
-		ret = PTR_ERR(coil->vana);
-		if (ret != -EPROBE_DEFER)
-			dev_err(&client->dev, "could not get regulator for vana\n");
-		return ret;
-	}
+	if (IS_ERR(coil->vana))
+		return dev_err_probe(&client->dev, PTR_ERR(coil->vana),
+				     "could not get regulator for vana\n");
 
 	coil->enable_gpio = devm_gpiod_get_optional(&client->dev, "enable",
 						    GPIOD_OUT_LOW);
-	if (IS_ERR(coil->enable_gpio)) {
-		ret = PTR_ERR(coil->enable_gpio);
-		if (ret != -EPROBE_DEFER)
-			dev_err(&client->dev, "could not get enable gpio\n");
-		return ret;
-	}
+	if (IS_ERR(coil->enable_gpio))
+		return dev_err_probe(&client->dev, PTR_ERR(coil->enable_gpio),
+				     "could not get enable gpio\n");
 
 	mutex_init(&coil->power_lock);
 
Signature · 3 lines
Regards,

Laurent Pinchart
#5 lore raw

PATCH 3/13 media: i2c: imx274: Switch to use dev_err_probe() helper

In reply to Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
 drivers/media/i2c/imx274.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/media/i2c/imx274.c +2 -3
index a00761b1e18c..0df515ab2cbf 100644
@@ -2060,9 +2060,8 @@ static int imx274_probe(struct i2c_client *client)
 	imx274->reset_gpio = devm_gpiod_get_optional(dev, "reset",
 						     GPIOD_OUT_HIGH);
 	if (IS_ERR(imx274->reset_gpio)) {
-		if (PTR_ERR(imx274->reset_gpio) != -EPROBE_DEFER)
-			dev_err(dev, "Reset GPIO not setup in DT");
-		ret = PTR_ERR(imx274->reset_gpio);
+		ret = dev_err_probe(dev, PTR_ERR(imx274->reset_gpio),
+				    "Reset GPIO not setup in DT");
 		goto err_me;
 	}
 
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 3/13
#6 lore raw

Re: [PATCH -next 03/13] media: i2c: imx274: Switch to use dev_err_probe() helper

Hi Yang,

Thank you for the patch.

Quoted 13 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
 drivers/media/i2c/imx274.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/media/i2c/imx274.c +0 -0
index a00761b1e18c..0df515ab2cbf 100644

drivers/media/i2c/imx274.c static int imx274_probe(struct i2c_client *client) · line 2064

Quoted 8 lines
drivers/media/i2c/imx274.c +2 -3
@@ -2060,9 +2060,8 @@ static int imx274_probe(struct i2c_client *client)
 	imx274->reset_gpio = devm_gpiod_get_optional(dev, "reset",
 						     GPIOD_OUT_HIGH);
 	if (IS_ERR(imx274->reset_gpio)) {
-		if (PTR_ERR(imx274->reset_gpio) != -EPROBE_DEFER)
-			dev_err(dev, "Reset GPIO not setup in DT");
-		ret = PTR_ERR(imx274->reset_gpio);
+		ret = dev_err_probe(dev, PTR_ERR(imx274->reset_gpio),
+				    "Reset GPIO not setup in DT");

While at it, could you add the missing \n at the end of the message ? With this fixed,

Quoted 3 lines
drivers/media/i2c/imx274.c +0 -0
 		goto err_me;
 	}
 
Signature · 3 lines
Regards,

Laurent Pinchart
#7 lore raw

PATCH 4/13 media: i2c: tc358743: Switch to use dev_err_probe() helper

In reply to Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
 drivers/media/i2c/tc358743.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/media/i2c/tc358743.c +3 -6
index 200841c1f5cf..9197fa0b1bc2 100644
@@ -1891,12 +1891,9 @@ static int tc358743_probe_of(struct tc358743_state *state)
 	int ret;
 
 	refclk = devm_clk_get(dev, "refclk");
-	if (IS_ERR(refclk)) {
-		if (PTR_ERR(refclk) != -EPROBE_DEFER)
-			dev_err(dev, "failed to get refclk: %ld\n",
-				PTR_ERR(refclk));
-		return PTR_ERR(refclk);
-	}
+	if (IS_ERR(refclk))
+		return dev_err_probe(dev, PTR_ERR(refclk),
+				     "failed to get refclk\n");
 
 	ep = of_graph_get_next_endpoint(dev->of_node, NULL);
 	if (!ep) {
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 4/13
#8 lore raw

Re: [PATCH -next 04/13] media: i2c: tc358743: Switch to use dev_err_probe() helper

Hi Yang,

Thank you for the patch.

Quoted 1 line · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe()

s/replace/replaced/

Same for all the other patches in this series.

Quoted 3 lines

which will check if error code is -EPROBE_DEFER.

Quoted 24 lines
---
 drivers/media/i2c/tc358743.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/media/i2c/tc358743.c +3 -6
index 200841c1f5cf..9197fa0b1bc2 100644
@@ -1891,12 +1891,9 @@ static int tc358743_probe_of(struct tc358743_state *state)
 	int ret;
 
 	refclk = devm_clk_get(dev, "refclk");
-	if (IS_ERR(refclk)) {
-		if (PTR_ERR(refclk) != -EPROBE_DEFER)
-			dev_err(dev, "failed to get refclk: %ld\n",
-				PTR_ERR(refclk));
-		return PTR_ERR(refclk);
-	}
+	if (IS_ERR(refclk))
+		return dev_err_probe(dev, PTR_ERR(refclk),
+				     "failed to get refclk\n");
 
 	ep = of_graph_get_next_endpoint(dev->of_node, NULL);
 	if (!ep) {
Signature · 3 lines
Regards,

Laurent Pinchart
#9 lore raw

PATCH 5/13 media: platform: mtk_mdp_comp: Switch to use dev_err_probe() helper

In reply to Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
 drivers/media/platform/mediatek/mdp/mtk_mdp_comp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/media/platform/mediatek/mdp/mtk_mdp_comp.c +2 -3
index 1e3833f1c9ae..ad5fab2d8bfa 100644
@@ -52,9 +52,8 @@ int mtk_mdp_comp_init(struct device *dev, struct device_node *node,
 	for (i = 0; i < ARRAY_SIZE(comp->clk); i++) {
 		comp->clk[i] = of_clk_get(node, i);
 		if (IS_ERR(comp->clk[i])) {
-			if (PTR_ERR(comp->clk[i]) != -EPROBE_DEFER)
-				dev_err(dev, "Failed to get clock\n");
-			ret = PTR_ERR(comp->clk[i]);
+			ret = dev_err_probe(dev, PTR_ERR(comp->clk[i]),
+					    "Failed to get clock\n");
 			goto put_dev;
 		}
 
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 5/13
#10 lore raw

Re: [PATCH -next 05/13] media: platform: mtk_mdp_comp: Switch to use dev_err_probe() helper

Hi Yang,

Thank you for the patch.

Quoted 4 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

Quoted 20 lines
---
 drivers/media/platform/mediatek/mdp/mtk_mdp_comp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/media/platform/mediatek/mdp/mtk_mdp_comp.c +2 -3
index 1e3833f1c9ae..ad5fab2d8bfa 100644
@@ -52,9 +52,8 @@ int mtk_mdp_comp_init(struct device *dev, struct device_node *node,
 	for (i = 0; i < ARRAY_SIZE(comp->clk); i++) {
 		comp->clk[i] = of_clk_get(node, i);
 		if (IS_ERR(comp->clk[i])) {
-			if (PTR_ERR(comp->clk[i]) != -EPROBE_DEFER)
-				dev_err(dev, "Failed to get clock\n");
-			ret = PTR_ERR(comp->clk[i]);
+			ret = dev_err_probe(dev, PTR_ERR(comp->clk[i]),
+					    "Failed to get clock\n");
 			goto put_dev;
 		}
 
Signature · 3 lines
Regards,

Laurent Pinchart
#11 lore raw

PATCH 6/13 media: platform: exynos4-is: Switch to use dev_err_probe() helper

In reply to Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
 drivers/media/platform/samsung/exynos4-is/media-dev.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/media/platform/samsung/exynos4-is/media-dev.c +1 -3
index 52b43ea04030..b7977d8da8e5 100644
@@ -1473,9 +1473,7 @@ static int fimc_md_probe(struct platform_device *pdev)
 
 	pinctrl = devm_pinctrl_get(dev);
 	if (IS_ERR(pinctrl)) {
-		ret = PTR_ERR(pinctrl);
-		if (ret != EPROBE_DEFER)
-			dev_err(dev, "Failed to get pinctrl: %d\n", ret);
+		dev_err_probe(dev, PTR_ERR(pinctrl), "Failed to get pinctrl\n");
 		goto err_clk;
 	}
 
Signature · 1 line
2.25.1
maintainer
#12 lore raw

Re: [PATCH -next 06/13] media: platform: exynos4-is: Switch to use dev_err_probe() helper

Hi Yang,

Thank you for the patch.

Quoted 13 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
 drivers/media/platform/samsung/exynos4-is/media-dev.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/media/platform/samsung/exynos4-is/media-dev.c +0 -0
index 52b43ea04030..b7977d8da8e5 100644

drivers/media/platform/samsung/exynos4-is/media-dev.c static int fimc_md_probe(struct platform_device *pdev) · line 1476

Quoted 7 lines
drivers/media/platform/samsung/exynos4-is/media-dev.c +1 -3
@@ -1473,9 +1473,7 @@ static int fimc_md_probe(struct platform_device *pdev)
 
 	pinctrl = devm_pinctrl_get(dev);
 	if (IS_ERR(pinctrl)) {
-		ret = PTR_ERR(pinctrl);
-		if (ret != EPROBE_DEFER)
-			dev_err(dev, "Failed to get pinctrl: %d\n", ret);
+		dev_err_probe(dev, PTR_ERR(pinctrl), "Failed to get pinctrl\n");

You need to set ret here.

Quoted 3 lines
drivers/media/platform/samsung/exynos4-is/media-dev.c +0 -0
 		goto err_clk;
 	}
 
Signature · 3 lines
Regards,

Laurent Pinchart
#13 lore raw

PATCH 7/13 media: stm32-dcmi: Switch to use dev_err_probe() helper

In reply to Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
 drivers/media/platform/st/stm32/stm32-dcmi.c | 27 +++++++-------------
 1 file changed, 9 insertions(+), 18 deletions(-)
drivers/media/platform/st/stm32/stm32-dcmi.c +9 -18
index 2ca95ab2b0fe..ec138843d090 100644
@@ -1946,12 +1946,9 @@ static int dcmi_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	dcmi->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
-	if (IS_ERR(dcmi->rstc)) {
-		if (PTR_ERR(dcmi->rstc) != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "Could not get reset control\n");
-
-		return PTR_ERR(dcmi->rstc);
-	}
+	if (IS_ERR(dcmi->rstc))
+		return dev_err_probe(&pdev->dev, PTR_ERR(dcmi->rstc),
+				     "Could not get reset control\n");
 
 	/* Get bus characteristics from devicetree */
 	np = of_graph_get_next_endpoint(np, NULL);
@@ -2003,20 +2000,14 @@ static int dcmi_probe(struct platform_device *pdev)
 	}
 
 	mclk = devm_clk_get(&pdev->dev, "mclk");
-	if (IS_ERR(mclk)) {
-		if (PTR_ERR(mclk) != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "Unable to get mclk\n");
-		return PTR_ERR(mclk);
-	}
+	if (IS_ERR(mclk))
+		return dev_err_probe(&pdev->dev, PTR_ERR(mclk),
+				     "Unable to get mclk\n");
 
 	chan = dma_request_chan(&pdev->dev, "tx");
-	if (IS_ERR(chan)) {
-		ret = PTR_ERR(chan);
-		if (ret != -EPROBE_DEFER)
-			dev_err(&pdev->dev,
-				"Failed to request DMA channel: %d\n", ret);
-		return ret;
-	}
+	if (IS_ERR(chan))
+		return dev_err_probe(&pdev->dev, PTR_ERR(chan),
+				     "Failed to request DMA channel\n");
 
 	dcmi->dma_max_burst = UINT_MAX;
 	ret = dma_get_slave_caps(chan, &caps);
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 7/13
#14 lore raw

Re: [PATCH -next 07/13] media: stm32-dcmi: Switch to use dev_err_probe() helper

Hi yang,

Thank you for the patch.

Quoted 4 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

Quoted 51 lines
---
 drivers/media/platform/st/stm32/stm32-dcmi.c | 27 +++++++-------------
 1 file changed, 9 insertions(+), 18 deletions(-)
drivers/media/platform/st/stm32/stm32-dcmi.c +9 -18
index 2ca95ab2b0fe..ec138843d090 100644
@@ -1946,12 +1946,9 @@ static int dcmi_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	dcmi->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
-	if (IS_ERR(dcmi->rstc)) {
-		if (PTR_ERR(dcmi->rstc) != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "Could not get reset control\n");
-
-		return PTR_ERR(dcmi->rstc);
-	}
+	if (IS_ERR(dcmi->rstc))
+		return dev_err_probe(&pdev->dev, PTR_ERR(dcmi->rstc),
+				     "Could not get reset control\n");
 
 	/* Get bus characteristics from devicetree */
 	np = of_graph_get_next_endpoint(np, NULL);
@@ -2003,20 +2000,14 @@ static int dcmi_probe(struct platform_device *pdev)
 	}
 
 	mclk = devm_clk_get(&pdev->dev, "mclk");
-	if (IS_ERR(mclk)) {
-		if (PTR_ERR(mclk) != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "Unable to get mclk\n");
-		return PTR_ERR(mclk);
-	}
+	if (IS_ERR(mclk))
+		return dev_err_probe(&pdev->dev, PTR_ERR(mclk),
+				     "Unable to get mclk\n");
 
 	chan = dma_request_chan(&pdev->dev, "tx");
-	if (IS_ERR(chan)) {
-		ret = PTR_ERR(chan);
-		if (ret != -EPROBE_DEFER)
-			dev_err(&pdev->dev,
-				"Failed to request DMA channel: %d\n", ret);
-		return ret;
-	}
+	if (IS_ERR(chan))
+		return dev_err_probe(&pdev->dev, PTR_ERR(chan),
+				     "Failed to request DMA channel\n");
 
 	dcmi->dma_max_burst = UINT_MAX;
 	ret = dma_get_slave_caps(chan, &caps);
Signature · 3 lines
Regards,

Laurent Pinchart
#15 lore raw

PATCH 8/13 media: omap3isp: Switch to use dev_err_probe() helper

In reply to Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
 drivers/media/platform/ti/omap3isp/isp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/platform/ti/omap3isp/isp.c +1 -2
index a6052df9bb19..5d6867b8f197 100644
@@ -1886,8 +1886,7 @@ static int isp_initialize_modules(struct isp_device *isp)
 
 	ret = omap3isp_ccp2_init(isp);
 	if (ret < 0) {
-		if (ret != -EPROBE_DEFER)
-			dev_err(isp->dev, "CCP2 initialization failed\n");
+		dev_err_probe(isp->dev, ret, "CCP2 initialization failed\n");
 		goto error_ccp2;
 	}
 
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 8/13
#16 lore raw

Re: [PATCH -next 08/13] media: omap3isp: Switch to use dev_err_probe() helper

Hi Yang,

Thank you for the patch.

Quoted 4 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

Quoted 18 lines
---
 drivers/media/platform/ti/omap3isp/isp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/platform/ti/omap3isp/isp.c +1 -2
index a6052df9bb19..5d6867b8f197 100644
@@ -1886,8 +1886,7 @@ static int isp_initialize_modules(struct isp_device *isp)
 
 	ret = omap3isp_ccp2_init(isp);
 	if (ret < 0) {
-		if (ret != -EPROBE_DEFER)
-			dev_err(isp->dev, "CCP2 initialization failed\n");
+		dev_err_probe(isp->dev, ret, "CCP2 initialization failed\n");
 		goto error_ccp2;
 	}
 
Signature · 3 lines
Regards,

Laurent Pinchart
#17 lore raw

PATCH 9/13 media: xilinx: csi2rxss: Switch to use dev_err_probe() helper

In reply to Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
 drivers/media/platform/xilinx/xilinx-csi2rxss.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/media/platform/xilinx/xilinx-csi2rxss.c +3 -5
index 29b53febc2e7..080e2483cc92 100644
@@ -976,11 +976,9 @@ static int xcsi2rxss_probe(struct platform_device *pdev)
 	/* Reset GPIO */
 	xcsi2rxss->rst_gpio = devm_gpiod_get_optional(dev, "video-reset",
 						      GPIOD_OUT_HIGH);
-	if (IS_ERR(xcsi2rxss->rst_gpio)) {
-		if (PTR_ERR(xcsi2rxss->rst_gpio) != -EPROBE_DEFER)
-			dev_err(dev, "Video Reset GPIO not setup in DT");
-		return PTR_ERR(xcsi2rxss->rst_gpio);
-	}
+	if (IS_ERR(xcsi2rxss->rst_gpio))
+		return dev_err_probe(dev, PTR_ERR(xcsi2rxss->rst_gpio),
+				     "Video Reset GPIO not setup in DT");
 
 	ret = xcsi2rxss_parse_of(xcsi2rxss);
 	if (ret < 0)
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 9/13
#18 lore raw

Re: [PATCH -next 09/13] media: xilinx: csi2rxss: Switch to use dev_err_probe() helper

Hi Yang,

Thank you for the patch.

Quoted 4 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

Quoted 23 lines
---
 drivers/media/platform/xilinx/xilinx-csi2rxss.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/media/platform/xilinx/xilinx-csi2rxss.c +3 -5
index 29b53febc2e7..080e2483cc92 100644
@@ -976,11 +976,9 @@ static int xcsi2rxss_probe(struct platform_device *pdev)
 	/* Reset GPIO */
 	xcsi2rxss->rst_gpio = devm_gpiod_get_optional(dev, "video-reset",
 						      GPIOD_OUT_HIGH);
-	if (IS_ERR(xcsi2rxss->rst_gpio)) {
-		if (PTR_ERR(xcsi2rxss->rst_gpio) != -EPROBE_DEFER)
-			dev_err(dev, "Video Reset GPIO not setup in DT");
-		return PTR_ERR(xcsi2rxss->rst_gpio);
-	}
+	if (IS_ERR(xcsi2rxss->rst_gpio))
+		return dev_err_probe(dev, PTR_ERR(xcsi2rxss->rst_gpio),
+				     "Video Reset GPIO not setup in DT");
 
 	ret = xcsi2rxss_parse_of(xcsi2rxss);
 	if (ret < 0)
Signature · 3 lines
Regards,

Laurent Pinchart
maintainer
#19 lore raw

Re: [PATCH -next 09/13] media: xilinx: csi2rxss: Switch to use dev_err_probe() helper

Quoted 16 lines · Laurent Pinchart

Hi Yang,

Thank you for the patch.

Quoted 4 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

Quoted 4 lines
---
 drivers/media/platform/xilinx/xilinx-csi2rxss.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
Quoted 16 lines
Quoted 6 lines
drivers/media/platform/xilinx/xilinx-csi2rxss.c +0 -0
index 29b53febc2e7..080e2483cc92 100644
@@ -976,11 +976,9 @@ static int xcsi2rxss_probe(struct platform_device *pdev)
 	/* Reset GPIO */

drivers/media/platform/xilinx/xilinx-csi2rxss.c static int xcsi2rxss_probe(struct platform_device *pdev) · line 981

Quoted 10 lines
drivers/media/platform/xilinx/xilinx-csi2rxss.c +3 -5
 	xcsi2rxss->rst_gpio = devm_gpiod_get_optional(dev, "video-reset",
 						      GPIOD_OUT_HIGH);
-	if (IS_ERR(xcsi2rxss->rst_gpio)) {
-		if (PTR_ERR(xcsi2rxss->rst_gpio) != -EPROBE_DEFER)
-			dev_err(dev, "Video Reset GPIO not setup in DT");
-		return PTR_ERR(xcsi2rxss->rst_gpio);
-	}
+	if (IS_ERR(xcsi2rxss->rst_gpio))
+		return dev_err_probe(dev, PTR_ERR(xcsi2rxss->rst_gpio),
+				     "Video Reset GPIO not setup in DT");

Actually, while at it, could you add the missing \n at the end of the message ?

Quoted 3 lines
Quoted 3 lines
drivers/media/platform/xilinx/xilinx-csi2rxss.c +0 -0
 	ret = xcsi2rxss_parse_of(xcsi2rxss);
 	if (ret < 0)
Signature · 3 lines
Regards,

Laurent Pinchart
#20 lore raw

PATCH 10/13 media: rc: gpio-ir-recv: Switch to use dev_err_probe() helper

In reply to Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
 drivers/media/rc/gpio-ir-recv.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/media/rc/gpio-ir-recv.c +3 -7
index 22e524b69806..8f1fff7af6c9 100644
@@ -74,13 +74,9 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	gpio_dev->gpiod = devm_gpiod_get(dev, NULL, GPIOD_IN);
-	if (IS_ERR(gpio_dev->gpiod)) {
-		rc = PTR_ERR(gpio_dev->gpiod);
-		/* Just try again if this happens */
-		if (rc != -EPROBE_DEFER)
-			dev_err(dev, "error getting gpio (%d)\n", rc);
-		return rc;
-	}
+	if (IS_ERR(gpio_dev->gpiod))
+		return dev_err_probe(dev, PTR_ERR(gpio_dev->gpiod),
+				     "error getting gpio\n");
 	gpio_dev->irq = gpiod_to_irq(gpio_dev->gpiod);
 	if (gpio_dev->irq < 0)
 		return gpio_dev->irq;
Signature · 1 line
2.25.1
maintainer
#21 lore raw

Re: [PATCH -next 10/13] media: rc: gpio-ir-recv: Switch to use dev_err_probe() helper

Quoted 16 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
 drivers/media/rc/gpio-ir-recv.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/media/rc/gpio-ir-recv.c +0 -0
index 22e524b69806..8f1fff7af6c9 100644
@@ -74,13 +74,9 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	gpio_dev->gpiod = devm_gpiod_get(dev, NULL, GPIOD_IN);

drivers/media/rc/gpio-ir-recv.c static int gpio_ir_recv_probe(struct platform_device *pdev) · line 79

Quoted 10 lines
drivers/media/rc/gpio-ir-recv.c +3 -7
-	if (IS_ERR(gpio_dev->gpiod)) {
-		rc = PTR_ERR(gpio_dev->gpiod);
-		/* Just try again if this happens */
-		if (rc != -EPROBE_DEFER)
-			dev_err(dev, "error getting gpio (%d)\n", rc);
-		return rc;
-	}
+	if (IS_ERR(gpio_dev->gpiod))
+		return dev_err_probe(dev, PTR_ERR(gpio_dev->gpiod),
+				     "error getting gpio\n");

Now the error number is no longer logged. That can't be good?

Sean

Quoted 5 lines
drivers/media/rc/gpio-ir-recv.c +0 -0
 	gpio_dev->irq = gpiod_to_irq(gpio_dev->gpiod);
 	if (gpio_dev->irq < 0)
 		return gpio_dev->irq;
Signature · 1 line
2.25.1
#22 lore raw

Re: [PATCH -next 10/13] media: rc: gpio-ir-recv: Switch to use dev_err_probe() helper

Hi,

Quoted 16 lines · Sean Young
Quoted 15 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
  drivers/media/rc/gpio-ir-recv.c | 10 +++-------
  1 file changed, 3 insertions(+), 7 deletions(-)
drivers/media/rc/gpio-ir-recv.c +0 -0
index 22e524b69806..8f1fff7af6c9 100644
@@ -74,13 +74,9 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
  		return -ENOMEM;
 
Quoted 12 lines

drivers/media/rc/gpio-ir-recv.c static int gpio_ir_recv_probe(struct platform_device *pdev) · line 79

Quoted 11 lines
drivers/media/rc/gpio-ir-recv.c +3 -7
  	gpio_dev->gpiod = devm_gpiod_get(dev, NULL, GPIOD_IN);
-	if (IS_ERR(gpio_dev->gpiod)) {
-		rc = PTR_ERR(gpio_dev->gpiod);
-		/* Just try again if this happens */
-		if (rc != -EPROBE_DEFER)
-			dev_err(dev, "error getting gpio (%d)\n", rc);
-		return rc;
-	}
+	if (IS_ERR(gpio_dev->gpiod))
+		return dev_err_probe(dev, PTR_ERR(gpio_dev->gpiod),
+				     "error getting gpio\n");

Now the error number is no longer logged. That can't be good?

Instead of error number, the error name is printed in dev_err_probe(), and  it's better for read.

Thanks,
Yang

Quoted 10 lines

Sean

Quoted 5 lines
drivers/media/rc/gpio-ir-recv.c +0 -0
  	gpio_dev->irq = gpiod_to_irq(gpio_dev->gpiod);
  	if (gpio_dev->irq < 0)
  		return gpio_dev->irq;
Signature · 1 line
2.25.1

.

maintainer Reviewed-by
#23 lore raw

Re: [PATCH -next 10/13] media: rc: gpio-ir-recv: Switch to use dev_err_probe() helper

Hi,

Quoted 28 lines · Yang Yingliang
Quoted 19 lines · Sean Young
Quoted 18 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
  drivers/media/rc/gpio-ir-recv.c | 10 +++-------
  1 file changed, 3 insertions(+), 7 deletions(-)
drivers/media/rc/gpio-ir-recv.c +0 -3
index 22e524b69806..8f1fff7af6c9 100644
@@ -74,13 +74,9 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
  		return -ENOMEM;
  	gpio_dev->gpiod = devm_gpiod_get(dev, NULL, GPIOD_IN);
-	if (IS_ERR(gpio_dev->gpiod)) {
-		rc = PTR_ERR(gpio_dev->gpiod);
-		/* Just try again if this happens */
Quoted 8 lines

drivers/media/rc/gpio-ir-recv.c static int gpio_ir_recv_probe(struct platform_device *pdev) · line 79

Quoted 7 lines
drivers/media/rc/gpio-ir-recv.c +3 -4
-		if (rc != -EPROBE_DEFER)
-			dev_err(dev, "error getting gpio (%d)\n", rc);
-		return rc;
-	}
+	if (IS_ERR(gpio_dev->gpiod))
+		return dev_err_probe(dev, PTR_ERR(gpio_dev->gpiod),
+				     "error getting gpio\n");

Now the error number is no longer logged. That can't be good?

Quoted 2 lines

Instead of error number, the error name is printed in dev_err_probe(), and it's better for read.

Yes, I should have checked this. This is much nicer, with the error printed with %pe. Thanks!

For the three drivers in drivers/media/rc/ :

Thanks
Sean

#24 lore raw

PATCH 11/13 media: rc: gpio-ir-tx: Switch to use dev_err_probe() helper

In reply to Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
 drivers/media/rc/gpio-ir-tx.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/media/rc/gpio-ir-tx.c +3 -6
index d3063ddb472e..2b829c146db1 100644
@@ -174,12 +174,9 @@ static int gpio_ir_tx_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	gpio_ir->gpio = devm_gpiod_get(&pdev->dev, NULL, GPIOD_OUT_LOW);
-	if (IS_ERR(gpio_ir->gpio)) {
-		if (PTR_ERR(gpio_ir->gpio) != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "Failed to get gpio (%ld)\n",
-				PTR_ERR(gpio_ir->gpio));
-		return PTR_ERR(gpio_ir->gpio);
-	}
+	if (IS_ERR(gpio_ir->gpio))
+		return dev_err_probe(&pdev->dev, PTR_ERR(gpio_ir->gpio),
+				     "Failed to get gpio\n");
 
 	rcdev->priv = gpio_ir;
 	rcdev->driver_name = DRIVER_NAME;
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 11/13
#25 lore raw

Re: [PATCH -next 11/13] media: rc: gpio-ir-tx: Switch to use dev_err_probe() helper

Hi Yang,

Thank you for the patch.

Quoted 4 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

Quoted 24 lines
---
 drivers/media/rc/gpio-ir-tx.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/media/rc/gpio-ir-tx.c +3 -6
index d3063ddb472e..2b829c146db1 100644
@@ -174,12 +174,9 @@ static int gpio_ir_tx_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	gpio_ir->gpio = devm_gpiod_get(&pdev->dev, NULL, GPIOD_OUT_LOW);
-	if (IS_ERR(gpio_ir->gpio)) {
-		if (PTR_ERR(gpio_ir->gpio) != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "Failed to get gpio (%ld)\n",
-				PTR_ERR(gpio_ir->gpio));
-		return PTR_ERR(gpio_ir->gpio);
-	}
+	if (IS_ERR(gpio_ir->gpio))
+		return dev_err_probe(&pdev->dev, PTR_ERR(gpio_ir->gpio),
+				     "Failed to get gpio\n");
 
 	rcdev->priv = gpio_ir;
 	rcdev->driver_name = DRIVER_NAME;
Signature · 3 lines
Regards,

Laurent Pinchart
#26 lore raw

PATCH 12/13 media: rc: ir-rx51: Switch to use dev_err_probe() helper

In reply to Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
 drivers/media/rc/ir-rx51.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/media/rc/ir-rx51.c +2 -7
index a3b145183260..85080c3d2053 100644
@@ -231,13 +231,8 @@ static int ir_rx51_probe(struct platform_device *dev)
 	struct rc_dev *rcdev;
 
 	pwm = pwm_get(&dev->dev, NULL);
-	if (IS_ERR(pwm)) {
-		int err = PTR_ERR(pwm);
-
-		if (err != -EPROBE_DEFER)
-			dev_err(&dev->dev, "pwm_get failed: %d\n", err);
-		return err;
-	}
+	if (IS_ERR(pwm))
+		return dev_err_probe(&dev->dev, PTR_ERR(pwm), "pwm_get failed\n");
 
 	/* Use default, in case userspace does not set the carrier */
 	ir_rx51.freq = DIV_ROUND_CLOSEST_ULL(pwm_get_period(pwm), NSEC_PER_SEC);
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 12/13
#27 lore raw

Re: [PATCH -next 12/13] media: rc: ir-rx51: Switch to use dev_err_probe() helper

Hi Yang,

Thank you for the patch.

Quoted 4 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

Quoted 24 lines
---
 drivers/media/rc/ir-rx51.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/media/rc/ir-rx51.c +2 -7
index a3b145183260..85080c3d2053 100644
@@ -231,13 +231,8 @@ static int ir_rx51_probe(struct platform_device *dev)
 	struct rc_dev *rcdev;
 
 	pwm = pwm_get(&dev->dev, NULL);
-	if (IS_ERR(pwm)) {
-		int err = PTR_ERR(pwm);
-
-		if (err != -EPROBE_DEFER)
-			dev_err(&dev->dev, "pwm_get failed: %d\n", err);
-		return err;
-	}
+	if (IS_ERR(pwm))
+		return dev_err_probe(&dev->dev, PTR_ERR(pwm), "pwm_get failed\n");
 
 	/* Use default, in case userspace does not set the carrier */
 	ir_rx51.freq = DIV_ROUND_CLOSEST_ULL(pwm_get_period(pwm), NSEC_PER_SEC);
Signature · 3 lines
Regards,

Laurent Pinchart
#28 lore raw

PATCH 13/13 media: uvcvideo: Switch to use dev_err_probe() helper

In reply to Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
 drivers/media/usb/uvc/uvc_driver.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/media/usb/uvc/uvc_driver.c +3 -6
index 744051b52e12..94f84c3c4712 100644
@@ -1554,12 +1554,9 @@ static int uvc_gpio_parse(struct uvc_device *dev)
 		return PTR_ERR_OR_ZERO(gpio_privacy);
 
 	irq = gpiod_to_irq(gpio_privacy);
-	if (irq < 0) {
-		if (irq != EPROBE_DEFER)
-			dev_err(&dev->udev->dev,
-				"No IRQ for privacy GPIO (%d)\n", irq);
-		return irq;
-	}
+	if (irq < 0)
+		return dev_err_probe(&dev->udev->dev, irq,
+				     "No IRQ for privacy GPIO\n");
 
 	unit = uvc_alloc_entity(UVC_EXT_GPIO_UNIT, UVC_EXT_GPIO_UNIT_ID, 0, 1);
 	if (!unit)
Signature · 1 line
2.25.1
Reviewed-by on v1 13/13
#29 lore raw

Re: [PATCH -next 13/13] media: uvcvideo: Switch to use dev_err_probe() helper

Quoted 5 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

Quoted 27 lines
---
 drivers/media/usb/uvc/uvc_driver.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/media/usb/uvc/uvc_driver.c +3 -7
index 744051b52e12..94f84c3c4712 100644
@@ -1554,12 +1554,9 @@ static int uvc_gpio_parse(struct uvc_device *dev)
                return PTR_ERR_OR_ZERO(gpio_privacy);
 
        irq = gpiod_to_irq(gpio_privacy);
-       if (irq < 0) {
-               if (irq != EPROBE_DEFER)
-                       dev_err(&dev->udev->dev,
-                               "No IRQ for privacy GPIO (%d)\n", irq);
-               return irq;
-       }
+       if (irq < 0)
+               return dev_err_probe(&dev->udev->dev, irq,
+                                    "No IRQ for privacy GPIO\n");
 
        unit = uvc_alloc_entity(UVC_EXT_GPIO_UNIT, UVC_EXT_GPIO_UNIT_ID, 0, 1);
        if (!unit)
--

2.25.1

Signature · 1 line
Ricardo Ribalda
maintainer Reviewed-by on v1 13/13
#30 lore raw

Re: [PATCH -next 13/13] media: uvcvideo: Switch to use dev_err_probe() helper

In reply to Yang Yingliang

Hi Yang,

Thank you for the patch.

Quoted 4 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

Quoted 24 lines
---
 drivers/media/usb/uvc/uvc_driver.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/media/usb/uvc/uvc_driver.c +3 -6
index 744051b52e12..94f84c3c4712 100644
@@ -1554,12 +1554,9 @@ static int uvc_gpio_parse(struct uvc_device *dev)
 		return PTR_ERR_OR_ZERO(gpio_privacy);
 
 	irq = gpiod_to_irq(gpio_privacy);
-	if (irq < 0) {
-		if (irq != EPROBE_DEFER)
-			dev_err(&dev->udev->dev,
-				"No IRQ for privacy GPIO (%d)\n", irq);
-		return irq;
-	}
+	if (irq < 0)
+		return dev_err_probe(&dev->udev->dev, irq,
+				     "No IRQ for privacy GPIO\n");
 
 	unit = uvc_alloc_entity(UVC_EXT_GPIO_UNIT, UVC_EXT_GPIO_UNIT_ID, 0, 1);
 	if (!unit)
Signature · 3 lines
Regards,

Laurent Pinchart
maintainer
#31 lore raw
In reply to Yang Yingliang

Hi Yang,

Quoted 3 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. It will print error code in a human readable way and simplify the code.

How would you like to get this merged ? A few patches need fixes, and all of them could benefit from a typo fix in the commit message. If you send a v2, it could be merged in one go instead of individual maintainers taking patches in their tree. Hans, would you handle this ?

Quoted 29 lines

Yang Yingliang (13):
media: platform: stm32-cec: Switch to use dev_err_probe() helper
media: i2c: ad5820: Switch to use dev_err_probe() helper
media: i2c: imx274: Switch to use dev_err_probe() helper
media: i2c: tc358743: Switch to use dev_err_probe() helper
media: platform: mtk_mdp_comp: Switch to use dev_err_probe() helper
media: platform: exynos4-is: Switch to use dev_err_probe() helper
media: stm32-dcmi: Switch to use dev_err_probe() helper
media: omap3isp: Switch to use dev_err_probe() helper
media: xilinx: csi2rxss: Switch to use dev_err_probe() helper
media: rc: gpio-ir-recv: Switch to use dev_err_probe() helper
media: rc: gpio-ir-tx: Switch to use dev_err_probe() helper
media: rc: ir-rx51: Switch to use dev_err_probe() helper
media: uvcvideo: Switch to use dev_err_probe() helper

 drivers/media/cec/platform/stm32/stm32-cec.c  |  9 +++----
 drivers/media/i2c/ad5820.c                    | 18 +++++--------
 drivers/media/i2c/imx274.c                    |  5 ++--
 drivers/media/i2c/tc358743.c                  |  9 +++----
 .../platform/mediatek/mdp/mtk_mdp_comp.c      |  5 ++--
 .../platform/samsung/exynos4-is/media-dev.c   |  4 +--
 drivers/media/platform/st/stm32/stm32-dcmi.c  | 27 +++++++------------
 drivers/media/platform/ti/omap3isp/isp.c      |  3 +--
 .../media/platform/xilinx/xilinx-csi2rxss.c   |  8 +++---
 drivers/media/rc/gpio-ir-recv.c               | 10 +++----
 drivers/media/rc/gpio-ir-tx.c                 |  9 +++----
 drivers/media/rc/ir-rx51.c                    |  9 ++-----
 drivers/media/usb/uvc/uvc_driver.c            |  9 +++----
 13 files changed, 41 insertions(+), 84 deletions(-)
Signature · 3 lines
Regards,

Laurent Pinchart
#32 lore raw
Quoted 10 lines · Laurent Pinchart

Hi Yang,

Quoted 3 lines · Yang Yingliang

In the probe path, dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER. It will print error code in a human readable way and simplify the code.

How would you like to get this merged ? A few patches need fixes, and all of them could benefit from a typo fix in the commit message. If you send a v2, it could be merged in one go instead of individual maintainers taking patches in their tree. Hans, would you handle this ?

OK, I can merge them in one and send a v2.

Thanks,
Yang

Quoted 30 lines
Quoted 30 lines

Yang Yingliang (13):
media: platform: stm32-cec: Switch to use dev_err_probe() helper
media: i2c: ad5820: Switch to use dev_err_probe() helper
media: i2c: imx274: Switch to use dev_err_probe() helper
media: i2c: tc358743: Switch to use dev_err_probe() helper
media: platform: mtk_mdp_comp: Switch to use dev_err_probe() helper
media: platform: exynos4-is: Switch to use dev_err_probe() helper
media: stm32-dcmi: Switch to use dev_err_probe() helper
media: omap3isp: Switch to use dev_err_probe() helper
media: xilinx: csi2rxss: Switch to use dev_err_probe() helper
media: rc: gpio-ir-recv: Switch to use dev_err_probe() helper
media: rc: gpio-ir-tx: Switch to use dev_err_probe() helper
media: rc: ir-rx51: Switch to use dev_err_probe() helper
media: uvcvideo: Switch to use dev_err_probe() helper

  drivers/media/cec/platform/stm32/stm32-cec.c  |  9 +++----
  drivers/media/i2c/ad5820.c                    | 18 +++++--------
  drivers/media/i2c/imx274.c                    |  5 ++--
  drivers/media/i2c/tc358743.c                  |  9 +++----
  .../platform/mediatek/mdp/mtk_mdp_comp.c      |  5 ++--
  .../platform/samsung/exynos4-is/media-dev.c   |  4 +--
  drivers/media/platform/st/stm32/stm32-dcmi.c  | 27 +++++++------------
  drivers/media/platform/ti/omap3isp/isp.c      |  3 +--
  .../media/platform/xilinx/xilinx-csi2rxss.c   |  8 +++---
  drivers/media/rc/gpio-ir-recv.c               | 10 +++----
  drivers/media/rc/gpio-ir-tx.c                 |  9 +++----
  drivers/media/rc/ir-rx51.c                    |  9 ++-----
  drivers/media/usb/uvc/uvc_driver.c            |  9 +++----
  13 files changed, 41 insertions(+), 84 deletions(-)