* [PATCH] drm/bridge: display-connector: Use dev_err_probe()
@ 2023-03-22 8:21 ye.xingchen
2023-03-22 8:35 ` Laurent Pinchart
2023-03-22 10:52 ` Neil Armstrong
0 siblings, 2 replies; 3+ messages in thread
From: ye.xingchen @ 2023-03-22 8:21 UTC (permalink / raw)
To: laurent.pinchart
Cc: andrzej.hajda, neil.armstrong, rfoss, jonas, jernej.skrabec,
airlied, daniel, dri-devel, linux-kernel
From: Ye Xingchen <ye.xingchen@zte.com.cn>
Replace the open-code with dev_err_probe() to simplify the code.
Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn>
---
drivers/gpu/drm/bridge/display-connector.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/bridge/display-connector.c b/drivers/gpu/drm/bridge/display-connector.c
index fbb3e102c02f..56ae511367b1 100644
--- a/drivers/gpu/drm/bridge/display-connector.c
+++ b/drivers/gpu/drm/bridge/display-connector.c
@@ -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 {
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/bridge: display-connector: Use dev_err_probe()
2023-03-22 8:21 [PATCH] drm/bridge: display-connector: Use dev_err_probe() ye.xingchen
@ 2023-03-22 8:35 ` Laurent Pinchart
2023-03-22 10:52 ` Neil Armstrong
1 sibling, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2023-03-22 8:35 UTC (permalink / raw)
To: ye.xingchen
Cc: andrzej.hajda, neil.armstrong, rfoss, jonas, jernej.skrabec,
airlied, daniel, dri-devel, linux-kernel
Hi Ye,
Thank you for the patch.
On Wed, Mar 22, 2023 at 04:21:33PM +0800, ye.xingchen@zte.com.cn wrote:
> From: Ye Xingchen <ye.xingchen@zte.com.cn>
>
> Replace the open-code with dev_err_probe() to simplify the code.
>
> Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/gpu/drm/bridge/display-connector.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/display-connector.c b/drivers/gpu/drm/bridge/display-connector.c
> index fbb3e102c02f..56ae511367b1 100644
> --- a/drivers/gpu/drm/bridge/display-connector.c
> +++ b/drivers/gpu/drm/bridge/display-connector.c
> @@ -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 {
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/bridge: display-connector: Use dev_err_probe()
2023-03-22 8:21 [PATCH] drm/bridge: display-connector: Use dev_err_probe() ye.xingchen
2023-03-22 8:35 ` Laurent Pinchart
@ 2023-03-22 10:52 ` Neil Armstrong
1 sibling, 0 replies; 3+ messages in thread
From: Neil Armstrong @ 2023-03-22 10:52 UTC (permalink / raw)
To: laurent.pinchart, ye.xingchen
Cc: andrzej.hajda, rfoss, jonas, jernej.skrabec, airlied, daniel,
dri-devel, linux-kernel
Hi,
On Wed, 22 Mar 2023 16:21:33 +0800, ye.xingchen@zte.com.cn 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
--
Neil
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-22 10:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-22 8:21 [PATCH] drm/bridge: display-connector: Use dev_err_probe() ye.xingchen
2023-03-22 8:35 ` Laurent Pinchart
2023-03-22 10:52 ` Neil Armstrong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox