mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: owen <qwt9588@gmail.com>
To: Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Robert Foss <robert.foss@linaro.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Xin Ji <xji@analogixsemi.com>, Sam Ravnborg <sam@ravnborg.org>,
	Pi-Hsun Shih <pihsun@chromium.org>,
	Tzung-Bi Shih <tzungbi@google.com>,
	Hsin-Yi Wang <hsinyi@chromium.org>
Cc: Maxime Ripard <maxime@cerno.tech>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	owen <qwt9588@gmail.com>
Subject: [PATCH v5] drm/bridge: anx7625: Return -EPROBE_DEFER if the dsi host was not found
Date: Mon, 17 Jan 2022 18:09:49 +0800	[thread overview]
Message-ID: <20220117100949.9542-1-qwt9588@gamil.com> (raw)

From: owen <qwt9588@gmail.com>

It will connect to the mipi dsi host and find the corresponding 
mipi dsi host node, but the node registered by the mipi dsi host 
has not been loaded yet. of_find_mipi_dsi_host_by_node() returns -EINVAL 
which causes the calling driver to fail.

If the anx7625 driver is loaded afterwards the driver requesting 
the mipi dsi host will not notice this.

Better approach is to return -EPROBE_DEFER in such case. 
Then when the anx7625 driver appears the driver requesting 
the mipi dsi host will be probed again.

Signed-off-by: owen <qwt9588@gmail.com>
---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 2346dbcc505f..297bbeb5aae0 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -1660,7 +1660,7 @@ static int anx7625_attach_dsi(struct anx7625_data *ctx)
 	host = of_find_mipi_dsi_host_by_node(ctx->pdata.mipi_host_node);
 	if (!host) {
 		DRM_DEV_ERROR(dev, "fail to find dsi host.\n");
-		return -EINVAL;
+		return -EPROBE_DEFER;
 	}
 
 	dsi = devm_mipi_dsi_device_register_full(dev, host, &info);
-- 
2.31.0


             reply	other threads:[~2022-01-17 10:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17 10:09 owen [this message]
2022-01-17 15:42 ` Robert Foss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220117100949.9542-1-qwt9588@gamil.com \
    --to=qwt9588@gmail.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@linux.ie \
    --cc=andrzej.hajda@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hsinyi@chromium.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime@cerno.tech \
    --cc=narmstrong@baylibre.com \
    --cc=pihsun@chromium.org \
    --cc=robert.foss@linaro.org \
    --cc=sam@ravnborg.org \
    --cc=tzungbi@google.com \
    --cc=xji@analogixsemi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®