Commit b49a2139 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen
Browse files

drm/omap: Remove connection checks from display .enable() and .remove()



The displays (connectors, panels and encoders) return an error from
their .enable() handler when the dss device is not connected. They also
disconnect the dss device explicitly from their .remove() handler if it
is still connected.

Those safety checks are not needed:

- The .enable() handler is called from code paths that access the dss
  devices chain from the display device, which is set to NULL when the
  device isn't connected.

- The .remove() handler can only be called when unloading the module as
  the driver has the suppress_bind_attrs attribute set, and a reference
  to the module is taken when constructing the dss devices chain, so the
  module can only be unloaded when the dss device is disconnected.

Remove the safety checks.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Tested-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent f8a8eabb
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -49,9 +49,6 @@ static int opa362_enable(struct omap_dss_device *dssdev)

	dev_dbg(dssdev->dev, "enable\n");

	if (!omapdss_device_is_connected(dssdev))
		return -ENODEV;

	if (omapdss_device_is_enabled(dssdev))
		return 0;

@@ -145,10 +142,6 @@ static int __exit opa362_remove(struct platform_device *pdev)
	if (omapdss_device_is_enabled(dssdev))
		opa362_disable(dssdev);

	WARN_ON(omapdss_device_is_connected(dssdev));
	if (omapdss_device_is_connected(dssdev))
		omapdss_device_disconnect(NULL, dssdev);

	return 0;
}

+0 −7
Original line number Diff line number Diff line
@@ -42,9 +42,6 @@ static int tfp410_enable(struct omap_dss_device *dssdev)
	struct omap_dss_device *src = dssdev->src;
	int r;

	if (!omapdss_device_is_connected(dssdev))
		return -ENODEV;

	if (omapdss_device_is_enabled(dssdev))
		return 0;

@@ -139,10 +136,6 @@ static int __exit tfp410_remove(struct platform_device *pdev)
	if (omapdss_device_is_enabled(dssdev))
		tfp410_disable(dssdev);

	WARN_ON(omapdss_device_is_connected(dssdev));
	if (omapdss_device_is_connected(dssdev))
		omapdss_device_disconnect(NULL, dssdev);

	return 0;
}

+0 −4
Original line number Diff line number Diff line
@@ -229,10 +229,6 @@ static int __exit tpd_remove(struct platform_device *pdev)
	if (omapdss_device_is_enabled(dssdev))
		tpd_disable(dssdev);

	WARN_ON(omapdss_device_is_connected(dssdev));
	if (omapdss_device_is_connected(dssdev))
		omapdss_device_disconnect(NULL, dssdev);

	return 0;
}

+5 −0
Original line number Diff line number Diff line
@@ -185,6 +185,11 @@ done:
}
EXPORT_SYMBOL(omapdss_device_get_next);

static bool omapdss_device_is_connected(struct omap_dss_device *dssdev)
{
	return dssdev->src;
}

int omapdss_device_connect(struct dss_device *dss,
			   struct omap_dss_device *src,
			   struct omap_dss_device *dst)
+0 −5
Original line number Diff line number Diff line
@@ -505,11 +505,6 @@ int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
int omapdss_compat_init(void);
void omapdss_compat_uninit(void);

static inline bool omapdss_device_is_connected(struct omap_dss_device *dssdev)
{
	return dssdev->src;
}

static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)
{
	return dssdev->state == OMAP_DSS_DISPLAY_ACTIVE;
Loading