diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2020-05-26 04:14:45 +0300 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2020-06-23 20:52:32 +0300 |
commit | 567e0d53097ce973a16e9fe115aac7568f892dfb (patch) | |
tree | 161902723720a896066e2a6318675f988f739556 /drivers/gpu/drm/bridge/simple-bridge.c | |
parent | 00686ac55d0a2192bb5cdd443272b8a5d60e557f (diff) | |
download | linux-567e0d53097ce973a16e9fe115aac7568f892dfb.tar.xz |
drm: bridge: simple-bridge: Make connector creation optional
Make the connector creation optional to enable usage of the
simple-bridge with the DRM bridge connector helper.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-8-laurent.pinchart+renesas@ideasonboard.com
Diffstat (limited to 'drivers/gpu/drm/bridge/simple-bridge.c')
-rw-r--r-- | drivers/gpu/drm/bridge/simple-bridge.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/gpu/drm/bridge/simple-bridge.c b/drivers/gpu/drm/bridge/simple-bridge.c index a1be269d833a..d974282c12b2 100644 --- a/drivers/gpu/drm/bridge/simple-bridge.c +++ b/drivers/gpu/drm/bridge/simple-bridge.c @@ -105,16 +105,14 @@ static int simple_bridge_attach(struct drm_bridge *bridge, struct simple_bridge *sbridge = drm_bridge_to_simple_bridge(bridge); int ret; - if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) { - DRM_ERROR("Fix bridge driver to make connector optional!"); - return -EINVAL; - } - ret = drm_bridge_attach(bridge->encoder, sbridge->next_bridge, bridge, DRM_BRIDGE_ATTACH_NO_CONNECTOR); if (ret < 0) return ret; + if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) + return 0; + if (!bridge->encoder) { DRM_ERROR("Missing encoder\n"); return -ENODEV; @@ -131,8 +129,7 @@ static int simple_bridge_attach(struct drm_bridge *bridge, return ret; } - drm_connector_attach_encoder(&sbridge->connector, - bridge->encoder); + drm_connector_attach_encoder(&sbridge->connector, bridge->encoder); return 0; } |