Commit d6a77ba0 authored by Linus Walleij's avatar Linus Walleij Committed by Sean Paul

Revert "drm/panel: Add device_link from panel device to DRM device"

This reverts commit 0c08754b.

commit 0c08754b
("drm/panel: Add device_link from panel device to DRM device")
creates a circular dependency under these circumstances:

1. The panel depends on dsi-host because it is MIPI-DSI child
   device.
2. dsi-host depends on the drm parent device (connector->dev->dev)
   this should be allowed.
3. drm parent dev (connector->dev->dev) depends on the panel
   after this patch.

This makes the dependency circular and while it appears it
does not affect any in-tree drivers (they do not seem to have
dsi hosts depending on the same parent device) this does not
seem right.

As noted in a response from Andrzej Hajda, the intent is
likely to make the panel dependent on the DRM device
(connector->dev) not its parent. But we have no way of
doing that since the DRM device doesn't contain any
struct device on its own (arguably it should).

Revert this until a proper approach is figured out.

Cc: Jyri Sarha <jsarha@ti.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180927124130.9102-1-linus.walleij@linaro.org
parent 337fe9f5
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/module.h> #include <linux/module.h>
#include <drm/drm_device.h>
#include <drm/drm_crtc.h> #include <drm/drm_crtc.h>
#include <drm/drm_panel.h> #include <drm/drm_panel.h>
...@@ -105,13 +104,6 @@ int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector) ...@@ -105,13 +104,6 @@ int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector)
if (panel->connector) if (panel->connector)
return -EBUSY; return -EBUSY;
panel->link = device_link_add(connector->dev->dev, panel->dev, 0);
if (!panel->link) {
dev_err(panel->dev, "failed to link panel to %s\n",
dev_name(connector->dev->dev));
return -EINVAL;
}
panel->connector = connector; panel->connector = connector;
panel->drm = connector->dev; panel->drm = connector->dev;
...@@ -133,8 +125,6 @@ EXPORT_SYMBOL(drm_panel_attach); ...@@ -133,8 +125,6 @@ EXPORT_SYMBOL(drm_panel_attach);
*/ */
int drm_panel_detach(struct drm_panel *panel) int drm_panel_detach(struct drm_panel *panel)
{ {
device_link_del(panel->link);
panel->connector = NULL; panel->connector = NULL;
panel->drm = NULL; panel->drm = NULL;
......
...@@ -89,7 +89,6 @@ struct drm_panel { ...@@ -89,7 +89,6 @@ struct drm_panel {
struct drm_device *drm; struct drm_device *drm;
struct drm_connector *connector; struct drm_connector *connector;
struct device *dev; struct device *dev;
struct device_link *link;
const struct drm_panel_funcs *funcs; const struct drm_panel_funcs *funcs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment