summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/omapdrm/dss/base.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-02-28 18:30:30 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2018-09-03 16:13:26 +0300
commit1f507968c30b0e86a307164a212ef11def1e5899 (patch)
tree3dc492e1081969be597f09f7457ab41bb642f4d9 /drivers/gpu/drm/omapdrm/dss/base.c
parentec727e3f61845d6d64b3c5eba464096d6cc7f8e9 (diff)
downloadlinux-1f507968c30b0e86a307164a212ef11def1e5899.tar.xz
drm/omap: dss: Move debug message and checks to connection handlers
The connectors, encoders and display duplicate the same debug messages and connection checks in their omap_dss_device connect and disconnect handlers. Move the code to the connect and disconnect wrappers. To simplify the code the connect function returns -EBUSY unconditionally if the device is already connected. This doesn't cause any change in practice: the connect handler of displays is never called on a connected device as it is only invoked during omapdrm initialization. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss/base.c')
-rw-r--r--drivers/gpu/drm/omapdrm/dss/base.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c
index 576fd3d13259..599ef628736b 100644
--- a/drivers/gpu/drm/omapdrm/dss/base.c
+++ b/drivers/gpu/drm/omapdrm/dss/base.c
@@ -105,6 +105,11 @@ struct omap_dss_device *omapdss_find_device_by_port(struct device_node *src,
int omapdss_device_connect(struct omap_dss_device *src,
struct omap_dss_device *dst)
{
+ dev_dbg(src->dev, "connect\n");
+
+ if (omapdss_device_is_connected(src))
+ return -EBUSY;
+
if (src->driver)
return src->driver->connect(src);
else
@@ -115,6 +120,13 @@ EXPORT_SYMBOL_GPL(omapdss_device_connect);
void omapdss_device_disconnect(struct omap_dss_device *src,
struct omap_dss_device *dst)
{
+ dev_dbg(src->dev, "disconnect\n");
+
+ if (!src->id && !omapdss_device_is_connected(src)) {
+ WARN_ON(!src->driver);
+ return;
+ }
+
if (src->driver)
src->driver->disconnect(src);
else