diff mbox series

[v2,03/21] drm/omap: Remove unnecessary display output sanity checks

Message ID 20180806202315.6329-4-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series omapdrm: Rework the HPD-related operations | expand

Commit Message

Laurent Pinchart Aug. 6, 2018, 8:22 p.m. UTC
The omapdrm driver checks at suspend and resume time whether the
displays it operates on have their driver operations set. This check is
unneeded, as all display drivers set the driver operations field at
probe time and never touch it afterwards. This is furthermore proven by
the dereferencing of the driver field without checking it first in
several locations.

The omapdss driver performs a similar check at shutdown time. This is
unneeded as well, as the for_each_dss_display() macro it uses to iterate
over displays locates the displays by checking the driver field
internally.

As those checks are unnecessary, remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
---
 drivers/gpu/drm/omapdrm/dss/dss.c  | 3 ---
 drivers/gpu/drm/omapdrm/omap_drv.c | 6 ------
 2 files changed, 9 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
index b473aff466d7..14ffe23b5ecf 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -1552,9 +1552,6 @@  static void dss_shutdown(struct platform_device *pdev)
 	DSSDBG("shutdown\n");
 
 	for_each_dss_display(dssdev) {
-		if (!dssdev->driver)
-			continue;
-
 		if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
 			dssdev->driver->disable(dssdev);
 	}
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index f2a69cfb6ebf..d0f6929857bb 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -723,9 +723,6 @@  static int omap_drm_suspend_all_displays(struct drm_device *ddev)
 	for (i = 0; i < priv->num_pipes; i++) {
 		struct omap_dss_device *display = priv->pipes[i].display;
 
-		if (!display->driver)
-			continue;
-
 		if (display->state == OMAP_DSS_DISPLAY_ACTIVE) {
 			display->driver->disable(display);
 			display->activate_after_resume = true;
@@ -745,9 +742,6 @@  static int omap_drm_resume_all_displays(struct drm_device *ddev)
 	for (i = 0; i < priv->num_pipes; i++) {
 		struct omap_dss_device *display = priv->pipes[i].display;
 
-		if (!display->driver)
-			continue;
-
 		if (display->activate_after_resume) {
 			display->driver->enable(display);
 			display->activate_after_resume = false;