[PATCH v1] drm/bridge: lt8912b: return EPROBE_DEFER if bridge is not found

Francesco Dolcini posted 1 patch 3 years ago
There is a newer version of this series
drivers/gpu/drm/bridge/lontium-lt8912b.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH v1] drm/bridge: lt8912b: return EPROBE_DEFER if bridge is not found
Posted by Francesco Dolcini 3 years ago
From: Matheus Castello <matheus.castello@toradex.com>

Returns EPROBE_DEFER when of_drm_find_bridge() fails, this is consistent
with what all the other DRM bridge drivers are doing and this is
required since the bridge might not be there when the driver is probed
and this should not be a fatal failure.

Cc: <stable@vger.kernel.org>
Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge")
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 drivers/gpu/drm/bridge/lontium-lt8912b.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
index 2019a8167d69..fec02e47cfdb 100644
--- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
+++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
@@ -676,8 +676,8 @@ static int lt8912_parse_dt(struct lt8912 *lt)
 
 	lt->hdmi_port = of_drm_find_bridge(port_node);
 	if (!lt->hdmi_port) {
-		dev_err(lt->dev, "%s: Failed to get hdmi port\n", __func__);
-		ret = -ENODEV;
+		dev_dbg(lt->dev, "%s: Failed to get hdmi port\n", __func__);
+		ret = -EPROBE_DEFER;
 		goto err_free_host_node;
 	}
 
-- 
2.25.1
Re: [PATCH v1] drm/bridge: lt8912b: return EPROBE_DEFER if bridge is not found
Posted by Laurent Pinchart 3 years ago
Hi Francesco,

Thank you for the patch.

On Wed, Mar 22, 2023 at 03:03:09PM +0100, Francesco Dolcini wrote:
> From: Matheus Castello <matheus.castello@toradex.com>
> 
> Returns EPROBE_DEFER when of_drm_find_bridge() fails, this is consistent
> with what all the other DRM bridge drivers are doing and this is
> required since the bridge might not be there when the driver is probed
> and this should not be a fatal failure.
> 
> Cc: <stable@vger.kernel.org>
> Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge")
> Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
>  drivers/gpu/drm/bridge/lontium-lt8912b.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> index 2019a8167d69..fec02e47cfdb 100644
> --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
> +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> @@ -676,8 +676,8 @@ static int lt8912_parse_dt(struct lt8912 *lt)
>  
>  	lt->hdmi_port = of_drm_find_bridge(port_node);
>  	if (!lt->hdmi_port) {
> -		dev_err(lt->dev, "%s: Failed to get hdmi port\n", __func__);
> -		ret = -ENODEV;
> +		dev_dbg(lt->dev, "%s: Failed to get hdmi port\n", __func__);

Please use dev_err_probe(). Apart from that, the patch looks fine to me.

> +		ret = -EPROBE_DEFER;
>  		goto err_free_host_node;
>  	}
>  

-- 
Regards,

Laurent Pinchart