Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent ec727e3f
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -48,11 +48,6 @@ static int tvc_connect(struct omap_dss_device *dssdev)
	struct omap_dss_device *in;
	int r;

	dev_dbg(ddata->dev, "connect\n");

	if (omapdss_device_is_connected(dssdev))
		return 0;

	in = omapdss_of_find_source_for_first_ep(ddata->dev->of_node);
	if (IS_ERR(in)) {
		dev_err(ddata->dev, "failed to find video source\n");
@@ -74,11 +69,6 @@ static void tvc_disconnect(struct omap_dss_device *dssdev)
	struct panel_drv_data *ddata = to_panel_data(dssdev);
	struct omap_dss_device *in = ddata->in;

	dev_dbg(ddata->dev, "disconnect\n");

	if (!omapdss_device_is_connected(dssdev))
		return;

	omapdss_device_disconnect(in, dssdev);

	omap_dss_put_device(in);
+0 −6
Original line number Diff line number Diff line
@@ -63,9 +63,6 @@ static int dvic_connect(struct omap_dss_device *dssdev)
	struct omap_dss_device *in;
	int r;

	if (omapdss_device_is_connected(dssdev))
		return 0;

	in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
	if (IS_ERR(in)) {
		dev_err(dssdev->dev, "failed to find video source\n");
@@ -87,9 +84,6 @@ static void dvic_disconnect(struct omap_dss_device *dssdev)
	struct panel_drv_data *ddata = to_panel_data(dssdev);
	struct omap_dss_device *in = ddata->in;

	if (!omapdss_device_is_connected(dssdev))
		return;

	omapdss_device_disconnect(in, dssdev);

	omap_dss_put_device(in);
+0 −10
Original line number Diff line number Diff line
@@ -58,11 +58,6 @@ static int hdmic_connect(struct omap_dss_device *dssdev)
	struct omap_dss_device *in;
	int r;

	dev_dbg(ddata->dev, "connect\n");

	if (omapdss_device_is_connected(dssdev))
		return 0;

	in = omapdss_of_find_source_for_first_ep(ddata->dev->of_node);
	if (IS_ERR(in)) {
		dev_err(ddata->dev, "failed to find video source\n");
@@ -84,11 +79,6 @@ static void hdmic_disconnect(struct omap_dss_device *dssdev)
	struct panel_drv_data *ddata = to_panel_data(dssdev);
	struct omap_dss_device *in = ddata->in;

	dev_dbg(ddata->dev, "disconnect\n");

	if (!omapdss_device_is_connected(dssdev))
		return;

	omapdss_device_disconnect(in, dssdev);

	omap_dss_put_device(in);
+0 −11
Original line number Diff line number Diff line
@@ -39,11 +39,6 @@ static int opa362_connect(struct omap_dss_device *dssdev,
	struct omap_dss_device *in;
	int r;

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

	if (omapdss_device_is_connected(dssdev))
		return -EBUSY;

	in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
	if (IS_ERR(in)) {
		dev_err(dssdev->dev, "failed to find video source\n");
@@ -69,12 +64,6 @@ static void opa362_disconnect(struct omap_dss_device *dssdev,
	struct panel_drv_data *ddata = to_panel_data(dssdev);
	struct omap_dss_device *in = ddata->in;

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

	WARN_ON(!omapdss_device_is_connected(dssdev));
	if (!omapdss_device_is_connected(dssdev))
		return;

	WARN_ON(dst != dssdev->dst);
	if (dst != dssdev->dst)
		return;
+0 −7
Original line number Diff line number Diff line
@@ -35,9 +35,6 @@ static int tfp410_connect(struct omap_dss_device *dssdev,
	struct omap_dss_device *in;
	int r;

	if (omapdss_device_is_connected(dssdev))
		return -EBUSY;

	in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
	if (IS_ERR(in)) {
		dev_err(dssdev->dev, "failed to find video source\n");
@@ -63,10 +60,6 @@ static void tfp410_disconnect(struct omap_dss_device *dssdev,
	struct panel_drv_data *ddata = to_panel_data(dssdev);
	struct omap_dss_device *in = ddata->in;

	WARN_ON(!omapdss_device_is_connected(dssdev));
	if (!omapdss_device_is_connected(dssdev))
		return;

	WARN_ON(dst != dssdev->dst);
	if (dst != dssdev->dst)
		return;
Loading