[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <63412979-d7fa-4147-8c38-f576503a3173@linaro.org>
Date: Tue, 28 Nov 2023 09:24:28 +0100
From: Neil Armstrong <neil.armstrong@...aro.org>
To: Linus Walleij <linus.walleij@...aro.org>,
Liu Ying <victor.liu@....com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Andrzej Hajda <andrzej.hajda@...el.com>,
Robert Foss <rfoss@...nel.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>
Cc: linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH 2/3] Revert "drm/bridge: panel: Check device dependency
before managing device link"
On 28/11/2023 00:10, Linus Walleij wrote:
> This reverts commit 39d5b6a64ace77d0c11c398d272218df5f939abb.
>
> This patch was causing build errors by using an unexported
> function from the device core, which Greg questions the
> saneness in exporting.
>
> Link: https://lore.kernel.org/lkml/CACRpkdaGzXD6HbiX7mVUNJAJtMEPG00Pp6+nJ1P0JrfJ-ArMvQ@mail.gmail.com/T/
> Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
> ---
> drivers/gpu/drm/bridge/panel.c | 27 +++++++++------------------
> 1 file changed, 9 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c
> index 5e8980023407..e48823a4f1ed 100644
> --- a/drivers/gpu/drm/bridge/panel.c
> +++ b/drivers/gpu/drm/bridge/panel.c
> @@ -23,7 +23,6 @@ struct panel_bridge {
> struct drm_panel *panel;
> struct device_link *link;
> u32 connector_type;
> - bool is_independent;
> };
>
> static inline struct panel_bridge *
> @@ -68,17 +67,12 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
> struct drm_device *drm_dev = bridge->dev;
> int ret;
>
> - panel_bridge->is_independent = !device_is_dependent(drm_dev->dev,
> - panel->dev);
> -
> - if (panel_bridge->is_independent) {
> - panel_bridge->link = device_link_add(drm_dev->dev, panel->dev,
> - DL_FLAG_STATELESS);
> - if (!panel_bridge->link) {
> - DRM_ERROR("Failed to add device link between %s and %s\n",
> - dev_name(drm_dev->dev), dev_name(panel->dev));
> - return -EINVAL;
> - }
> + panel_bridge->link = device_link_add(drm_dev->dev, panel->dev,
> + DL_FLAG_STATELESS);
> + if (!panel_bridge->link) {
> + DRM_ERROR("Failed to add device link between %s and %s\n",
> + dev_name(drm_dev->dev), dev_name(panel->dev));
> + return -EINVAL;
> }
>
> if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
> @@ -86,8 +80,7 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
>
> if (!bridge->encoder) {
> DRM_ERROR("Missing encoder\n");
> - if (panel_bridge->is_independent)
> - device_link_del(panel_bridge->link);
> + device_link_del(panel_bridge->link);
> return -ENODEV;
> }
>
> @@ -99,8 +92,7 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
> panel_bridge->connector_type);
> if (ret) {
> DRM_ERROR("Failed to initialize connector\n");
> - if (panel_bridge->is_independent)
> - device_link_del(panel_bridge->link);
> + device_link_del(panel_bridge->link);
> return ret;
> }
>
> @@ -123,8 +115,7 @@ static void panel_bridge_detach(struct drm_bridge *bridge)
> struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
> struct drm_connector *connector = &panel_bridge->connector;
>
> - if (panel_bridge->is_independent)
> - device_link_del(panel_bridge->link);
> + device_link_del(panel_bridge->link);
>
> /*
> * Cleanup the connector if we know it was initialized.
>
Acked-by: Neil Armstrong <neil.armstrong@...aro.org>
Powered by blists - more mailing lists