dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Thierry Reding <thierry.reding@gmail.com>,
	dri-devel@lists.freedesktop.org, Eric Anholt <eric@anholt.net>
Cc: David Airlie <airlied@linux.ie>,
	Boris Brezillon <boris.brezillon@bootlin.com>
Subject: [PATCH v3 3/4] drm/of: Make drm_of_find_panel_or_bridge() fail when the device is disabled
Date: Wed,  9 May 2018 15:00:41 +0200	[thread overview]
Message-ID: <20180509130042.9435-4-boris.brezillon@bootlin.com> (raw)
In-Reply-To: <20180509130042.9435-1-boris.brezillon@bootlin.com>

There's no point searching for a drm_bridge or drm_panel if the OF node
we're pointing has a status property that is not "okay" or "ok". Just
return -ENODEV in this case.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
---
Changes in v3:
- Add Thierry's A-b/R-b

Changes in v2:
- New commit
---
 drivers/gpu/drm/drm_of.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c
index 81d3f76c43f3..7678100fd772 100644
--- a/drivers/gpu/drm/drm_of.c
+++ b/drivers/gpu/drm/drm_of.c
@@ -238,6 +238,11 @@ int drm_of_find_panel_or_bridge(const struct device_node *np,
 	if (!remote)
 		return -ENODEV;
 
+	if (!of_device_is_available(remote)) {
+		of_node_put(remote);
+		return -ENODEV;
+	}
+
 	if (panel) {
 		*panel = of_drm_find_panel(remote);
 		if (!IS_ERR(*panel))
-- 
2.14.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2018-05-09 13:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 13:00 [PATCH v3 0/4] drm/panel: Handle the "panel is missing" case properly Boris Brezillon
2018-05-09 13:00 ` [PATCH v3 1/4] drm/panel: Make of_drm_find_panel() return an ERR_PTR() instead of NULL Boris Brezillon
2018-05-09 13:00 ` [PATCH v3 2/4] drm/panel: Let of_drm_find_panel() return -ENODEV when the panel is disabled Boris Brezillon
2018-05-09 13:00 ` Boris Brezillon [this message]
2018-05-09 13:00 ` [PATCH v3 4/4] drm/vc4: Support the case where the DSI device " Boris Brezillon
2018-05-16  9:17   ` Eric Anholt
2018-07-10  9:19 ` [PATCH v3 0/4] drm/panel: Handle the "panel is missing" case properly Thierry Reding
2018-07-11 16:20   ` Eric Anholt

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=20180509130042.9435-4-boris.brezillon@bootlin.com \
    --to=boris.brezillon@bootlin.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric@anholt.net \
    --cc=thierry.reding@gmail.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;
as well as URLs for NNTP newsgroup(s).