Skip to contentSkip to conversation

drm/bridge: display-connector: Use dev_err_probe()

PATCH Applied [email protected] 3 participants 3 messages Mar 22, 2023

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

PATCH 1/1 drm/bridge: display-connector: Use dev_err_probe()

From: Ye Xingchen <[email protected]>

Replace the open-code with dev_err_probe() to simplify the code.

---
 drivers/gpu/drm/bridge/display-connector.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/gpu/drm/bridge/display-connector.c +3 -6
index fbb3e102c02f..56ae511367b1 100644
@@ -271,12 +271,9 @@ static int display_connector_probe(struct platform_device *pdev)
 	    type == DRM_MODE_CONNECTOR_DisplayPort) {
 		conn->hpd_gpio = devm_gpiod_get_optional(&pdev->dev, "hpd",
 							 GPIOD_IN);
-		if (IS_ERR(conn->hpd_gpio)) {
-			if (PTR_ERR(conn->hpd_gpio) != -EPROBE_DEFER)
-				dev_err(&pdev->dev,
-					"Unable to retrieve HPD GPIO\n");
-			return PTR_ERR(conn->hpd_gpio);
-		}
+		if (IS_ERR(conn->hpd_gpio))
+			return dev_err_probe(&pdev->dev, PTR_ERR(conn->hpd_gpio),
+					     "Unable to retrieve HPD GPIO\n");
 
 		conn->hpd_irq = gpiod_to_irq(conn->hpd_gpio);
 	} else {
Signature · 1 line
2.25.1
reviewer Reviewed-by on v1 1/1
#1 lore raw

Hi Ye,

Thank you for the patch.

Quoted 5 lines · On Wed, Mar 22, 2023 at 04:21:33PM +0800, [email protected] wrote:

From: Ye Xingchen <[email protected]>

Replace the open-code with dev_err_probe() to simplify the code.

Quoted 24 lines
---
 drivers/gpu/drm/bridge/display-connector.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/gpu/drm/bridge/display-connector.c +3 -6
index fbb3e102c02f..56ae511367b1 100644
@@ -271,12 +271,9 @@ static int display_connector_probe(struct platform_device *pdev)
 	    type == DRM_MODE_CONNECTOR_DisplayPort) {
 		conn->hpd_gpio = devm_gpiod_get_optional(&pdev->dev, "hpd",
 							 GPIOD_IN);
-		if (IS_ERR(conn->hpd_gpio)) {
-			if (PTR_ERR(conn->hpd_gpio) != -EPROBE_DEFER)
-				dev_err(&pdev->dev,
-					"Unable to retrieve HPD GPIO\n");
-			return PTR_ERR(conn->hpd_gpio);
-		}
+		if (IS_ERR(conn->hpd_gpio))
+			return dev_err_probe(&pdev->dev, PTR_ERR(conn->hpd_gpio),
+					     "Unable to retrieve HPD GPIO\n");
 
 		conn->hpd_irq = gpiod_to_irq(conn->hpd_gpio);
 	} else {
Signature · 3 lines
Regards,

Laurent Pinchart
maintainer Applied
#2 lore raw
In reply to [email protected]

Hi,

Quoted 3 lines · On Wed, 22 Mar 2023 16:21:33 +0800, [email protected] wrote:

Replace the open-code with dev_err_probe() to simplify the code.

Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next)

[1/1] drm/bridge: display-connector: Use dev_err_probe()

      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=ed8f4e1002781c47813e4e2b37ad15b927fd8b67
Signature · 1 line
Neil