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>
This commit is contained in:
Laurent Pinchart
2018-09-08 11:45:14 +03:00
committed by Tomi Valkeinen
szülő b49a2139ba
commit 3f3623dd0f
14 fájl változott, egészen pontosan 25 új sor hozzáadva és 64 régi sor törölve

Fájl megtekintése

@@ -138,9 +138,6 @@ static void nec_8048_disable(struct omap_dss_device *dssdev)
struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *src = dssdev->src;
if (!omapdss_device_is_enabled(dssdev))
return;
gpiod_set_value_cansleep(ddata->res_gpio, 0);
src->ops->disable(src);
@@ -226,7 +223,8 @@ static int nec_8048_remove(struct spi_device *spi)
omapdss_device_unregister(dssdev);
nec_8048_disable(dssdev);
if (omapdss_device_is_enabled(dssdev))
nec_8048_disable(dssdev);
return 0;
}