diff mbox series

[3/3] drm/msm: Don't fail bind if nothing connected to dsi

Message ID 20180730152658.157098-4-seanpaul@chromium.org (mailing list archive)
State Not Applicable, archived
Delegated to: Andy Gross
Headers show
Series drm/msm: dsi: Properly handle disconnected secondary dsi block | expand

Commit Message

Sean Paul July 30, 2018, 3:26 p.m. UTC
If there is no bridge or panel connected to a dsi node, don't fail the
entire msm bind. Just ignore the dsi block and move on.

Cc: Doug Anderson <dianders@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 drivers/gpu/drm/msm/dsi/dsi.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Abhinav Kumar July 30, 2018, 10:30 p.m. UTC | #1
On 2018-07-30 08:26, Sean Paul wrote:
> If there is no bridge or panel connected to a dsi node, don't fail the
> entire msm bind. Just ignore the dsi block and move on.
> 
> Cc: Doug Anderson <dianders@chromium.org>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org>
> ---
>  drivers/gpu/drm/msm/dsi/dsi.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/dsi/dsi.c 
> b/drivers/gpu/drm/msm/dsi/dsi.c
> index ee07d58c2d97..a9768f823290 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi.c
> @@ -118,8 +118,13 @@ static int dsi_bind(struct device *dev, struct
> device *master, void *data)
> 
>  	DBG("");
>  	msm_dsi = dsi_init(pdev);
> -	if (IS_ERR(msm_dsi))
> -		return PTR_ERR(msm_dsi);
> +	if (IS_ERR(msm_dsi)) {
> +		/* Don't fail the bind if the dsi port is not connected */
> +		if (PTR_ERR(msm_dsi) == -ENODEV)
> +			return 0;
> +		else
> +			return PTR_ERR(msm_dsi);
> +	}
> 
>  	priv->dsi[msm_dsi->id] = msm_dsi;
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
index ee07d58c2d97..a9768f823290 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -118,8 +118,13 @@  static int dsi_bind(struct device *dev, struct device *master, void *data)
 
 	DBG("");
 	msm_dsi = dsi_init(pdev);
-	if (IS_ERR(msm_dsi))
-		return PTR_ERR(msm_dsi);
+	if (IS_ERR(msm_dsi)) {
+		/* Don't fail the bind if the dsi port is not connected */
+		if (PTR_ERR(msm_dsi) == -ENODEV)
+			return 0;
+		else
+			return PTR_ERR(msm_dsi);
+	}
 
 	priv->dsi[msm_dsi->id] = msm_dsi;