From: Neil Armstrong <narmstrong@baylibre.com>
To: Jeffy Chen <jeffy.chen@rock-chips.com>, linux-kernel@vger.kernel.org
Cc: briannorris@chromium.org, seanpaul@chromium.org,
dianders@chromium.org, heiko@sntech.de, tfiga@chromium.org,
Andrzej Hajda <a.hajda@samsung.com>,
Romain Perier <romain.perier@collabora.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Jonathan Corbet <corbet@lwn.net>,
dri-devel@lists.freedesktop.org,
Kevin Hilman <khilman@baylibre.com>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Russell King <rmk+kernel@armlinux.org.uk>,
linux-rockchip@lists.infradead.org,
Carlo Caione <carlo@caione.org>,
linux-amlogic@lists.infradead.org,
Archit Taneja <architt@codeaurora.org>,
linux-arm-kernel@lists.infradead.org,
Mark Yao <mark.yao@rock-chips.com>,
linux-renesas-soc@vger.kernel.org,
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
Jose Abreu <Jose.Abreu@synopsys.com>,
David Airlie <airlied@linux.ie>
Subject: Re: [PATCH v5 8/9] drm/bridge/synopsys: dw-hdmi: Do not use device's drvdata
Date: Wed, 18 Oct 2017 18:03:03 +0200 [thread overview]
Message-ID: <40e49fc2-fd7d-12ab-fe49-b4d0586b65a1@baylibre.com> (raw)
In-Reply-To: <20171018120944.7819-9-jeffy.chen@rock-chips.com>
On 18/10/2017 14:09, Jeffy Chen wrote:
> Let plat drivers own the drvdata, so that they could cleanup resources
> in their unbind().
>
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> ---
>
> Changes in v5: None
>
> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 43 ++++++++++-------------------
> drivers/gpu/drm/imx/dw_hdmi-imx.c | 22 +++++++++------
> drivers/gpu/drm/meson/meson_dw_hdmi.c | 20 ++++++++++----
> drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c | 14 ++++++++--
> drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 23 ++++++++-------
> include/drm/bridge/dw_hdmi.h | 17 ++++++------
> 6 files changed, 77 insertions(+), 62 deletions(-)
>
[...]
> diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
> index cef414466f9f..fc29f69f7108 100644
> --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
> +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
> @@ -138,6 +138,8 @@ struct meson_dw_hdmi {
> struct clk *hdmi_pclk;
> struct clk *venci_clk;
> u32 irq_stat;
> +
> + struct dw_hdmi *hdmi;
> };
> #define encoder_to_meson_dw_hdmi(x) \
> container_of(x, struct meson_dw_hdmi, encoder)
> @@ -526,7 +528,7 @@ static irqreturn_t dw_hdmi_top_thread_irq(int irq, void *dev_id)
> if (stat & HDMITX_TOP_INTR_HPD_RISE)
> hpd_connected = true;
>
> - dw_hdmi_setup_rx_sense(dw_hdmi->dev, hpd_connected,
> + dw_hdmi_setup_rx_sense(dw_hdmi->hdmi, hpd_connected,
> hpd_connected);
>
> drm_helper_hpd_irq_event(dw_hdmi->encoder.dev);
> @@ -865,9 +867,14 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
> dw_plat_data->input_bus_format = MEDIA_BUS_FMT_YUV8_1X24;
> dw_plat_data->input_bus_encoding = V4L2_YCBCR_ENC_709;
>
> - ret = dw_hdmi_bind(pdev, encoder, &meson_dw_hdmi->dw_plat_data);
> - if (ret)
> - return ret;
> + meson_dw_hdmi->hdmi = dw_hdmi_bind(pdev, encoder,
> + &meson_dw_hdmi->dw_plat_data);
> + if (IS_ERR(meson_dw_hdmi->hdmi)) {
> + encoder->funcs->destroy(encoder);
> + return PTR_ERR(meson_dw_hdmi->hdmi);
> + }
> +
> + dev_set_drvdata(dev, meson_dw_hdmi);
>
> DRM_DEBUG_DRIVER("HDMI controller initialized\n");
>
> @@ -877,7 +884,10 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
> static void meson_dw_hdmi_unbind(struct device *dev, struct device *master,
> void *data)
> {
> - dw_hdmi_unbind(dev);
> + struct meson_dw_hdmi *meson_dw_hdmi = dev_get_drvdata(dev);
> +
> + dw_hdmi_unbind(meson_dw_hdmi->hdmi);
> + meson_dw_hdmi->encoder.funcs->destroy(&meson_dw_hdmi->encoder);
> }
>
> static const struct component_ops meson_dw_hdmi_ops = {
[...]
For meson/meson_dw_hdmi.c :
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
next prev parent reply other threads:[~2017-10-18 16:03 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 ` [PATCH v5 7/9] drm/bridge/synopsys: dw-hdmi: Add missing bridge detach Jeffy Chen
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 [this message]
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=40e49fc2-fd7d-12ab-fe49-b4d0586b65a1@baylibre.com \
--to=narmstrong@baylibre.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=carlo@caione.org \
--cc=corbet@lwn.net \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=jeffy.chen@rock-chips.com \
--cc=khilman@baylibre.com \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mark.yao@rock-chips.com \
--cc=p.zabel@pengutronix.de \
--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®