aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_encoder.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-09-08 04:45:14 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2019-03-18 05:42:11 -0400
commit3f3623dd0f881dd5615097fdc9eeeb1ec732e59a (patch)
tree4e9d22064b71ce48e28efc4478b79bdb35be3d46 /drivers/gpu/drm/omapdrm/omap_encoder.c
parentb49a2139ba67da43915a483a2a7e8490ba6c2b57 (diff)
drm/omap: Remove enable checks from display .enable() and .remove()
The displays (connectors, panels and encoders) bail out from their .enable() and .disable() handlers if the dss device is already enabled or disabled. Those safety checks are not needed when the functions are called through the omapdss_device_ops, as the .enable() and .disable() handlers are called from the DRM atomic helpers that already guarantee that no double enabling or disabling can occur. However, the handlers are also called directly from the .remove() handler. While this shouldn't be needed either as the modules can't be removed as long as the device is in use, it's still a good practice to disable the device explicitly. There is currently a safety check in .remove() in some drivers but not all of them. Remove the safety checks from the .enable() and .disable() handlers, and add missing ones in the .remove() handler. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_encoder.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_encoder.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_encoder.c b/drivers/gpu/drm/omapdrm/omap_encoder.c
index 3c3d88e1df38..d14d465392dd 100644
--- a/drivers/gpu/drm/omapdrm/omap_encoder.c
+++ b/drivers/gpu/drm/omapdrm/omap_encoder.c
@@ -151,9 +151,6 @@ static void omap_encoder_disable(struct drm_encoder *encoder)
151 151
152 dev_dbg(dev->dev, "disable(%s)\n", dssdev->name); 152 dev_dbg(dev->dev, "disable(%s)\n", dssdev->name);
153 153
154 if (!omapdss_device_is_enabled(dssdev))
155 return;
156
157 dssdev->ops->disable(dssdev); 154 dssdev->ops->disable(dssdev);
158 155
159 dssdev->state = OMAP_DSS_DISPLAY_DISABLED; 156 dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
@@ -168,9 +165,6 @@ static void omap_encoder_enable(struct drm_encoder *encoder)
168 165
169 dev_dbg(dev->dev, "enable(%s)\n", dssdev->name); 166 dev_dbg(dev->dev, "enable(%s)\n", dssdev->name);
170 167
171 if (omapdss_device_is_enabled(dssdev))
172 return;
173
174 r = dssdev->ops->enable(dssdev); 168 r = dssdev->ops->enable(dssdev);
175 if (r) { 169 if (r) {
176 dev_err(dev->dev, "Failed to enable display '%s': %d\n", 170 dev_err(dev->dev, "Failed to enable display '%s': %d\n",