mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeffy Chen <jeffy.chen@rock-chips.com>
To: linux-kernel@vger.kernel.org
Cc: briannorris@chromium.org, seanpaul@chromium.org,
	dianders@chromium.org, heiko@sntech.de, tfiga@chromium.org,
	Jeffy Chen <jeffy.chen@rock-chips.com>,
	Andrzej Hajda <a.hajda@samsung.com>,
	Romain Perier <romain.perier@collabora.com>,
	Archit Taneja <architt@codeaurora.org>,
	dri-devel@lists.freedesktop.org,
	Russell King <rmk+kernel@armlinux.org.uk>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	David Airlie <airlied@linux.ie>,
	Jose Abreu <Jose.Abreu@synopsys.com>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Subject: [PATCH v5 7/9] drm/bridge/synopsys: dw-hdmi: Add missing bridge detach
Date: Wed, 18 Oct 2017 20:09:42 +0800	[thread overview]
Message-ID: <20171018120944.7819-8-jeffy.chen@rock-chips.com> (raw)
In-Reply-To: <20171018120944.7819-1-jeffy.chen@rock-chips.com>

We inited connector in attach(), so need a detach() to cleanup.

Also fix wrong use of dw_hdmi_remove() in bind().

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

Changes in v5: None

 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index bf14214fa464..ff1b3d2b5d06 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -1966,6 +1966,13 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge)
 	return 0;
 }
 
+static void dw_hdmi_bridge_detach(struct drm_bridge *bridge)
+{
+	struct dw_hdmi *hdmi = bridge->driver_private;
+
+	drm_connector_cleanup(&hdmi->connector);
+}
+
 static enum drm_mode_status
 dw_hdmi_bridge_mode_valid(struct drm_bridge *bridge,
 			  const struct drm_display_mode *mode)
@@ -2022,6 +2029,7 @@ static void dw_hdmi_bridge_enable(struct drm_bridge *bridge)
 
 static const struct drm_bridge_funcs dw_hdmi_bridge_funcs = {
 	.attach = dw_hdmi_bridge_attach,
+	.detach = dw_hdmi_bridge_detach,
 	.enable = dw_hdmi_bridge_enable,
 	.disable = dw_hdmi_bridge_disable,
 	.mode_set = dw_hdmi_bridge_mode_set,
@@ -2591,7 +2599,7 @@ int dw_hdmi_bind(struct platform_device *pdev, struct drm_encoder *encoder,
 
 	ret = drm_bridge_attach(encoder, &hdmi->bridge, NULL);
 	if (ret) {
-		dw_hdmi_remove(pdev);
+		__dw_hdmi_remove(hdmi);
 		DRM_ERROR("Failed to initialize bridge with drm\n");
 		return ret;
 	}
-- 
2.11.0

  parent reply	other threads:[~2017-10-18 12:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20171018120944.7819-1-jeffy.chen@rock-chips.com>
2017-10-18 12:09 ` [PATCH v5 1/9] arm64: dts: rockchip: Enable edp disaplay on kevin Jeffy Chen
2017-10-18 12:09 ` [PATCH v5 2/9] drm/rockchip: analogix_dp: Remove unnecessary init code Jeffy Chen
2017-10-18 12:09 ` [PATCH v5 3/9] drm/bridge: analogix: Do not use device's drvdata Jeffy Chen
2017-10-18 12:09 ` [PATCH v5 4/9] drm/bridge: analogix_dp: Fix connector & encoder cleanup Jeffy Chen
2017-10-18 13:22   ` Andrzej Hajda
2017-10-18 12:09 ` [PATCH v5 5/9] drm/rockchip: dw-mipi-dsi: Fix error handling path Jeffy Chen
2017-10-18 12:09 ` [PATCH v5 6/9] drm/rockchip: inno_hdmi: " Jeffy Chen
2017-10-18 12:09 ` Jeffy Chen [this message]
2017-10-18 12:09 ` [PATCH v5 8/9] drm/bridge/synopsys: dw-hdmi: Do not use device's drvdata Jeffy Chen
2017-10-18 16:03   ` Neil Armstrong
2017-10-18 12:09 ` [PATCH v5 9/9] drm/rockchip: dw_hdmi: Fix error handling path Jeffy Chen

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=20171018120944.7819-8-jeffy.chen@rock-chips.com \
    --to=jeffy.chen@rock-chips.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=a.hajda@samsung.com \
    --cc=airlied@linux.ie \
    --cc=architt@codeaurora.org \
    --cc=briannorris@chromium.org \
    --cc=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=narmstrong@baylibre.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=romain.perier@collabora.com \
    --cc=seanpaul@chromium.org \
    --cc=tfiga@chromium.org \
    /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®