drm/omap: dss: Merge two disconnection helpers

To simplify the pipeline disconnection handling merge the
omapdss_device_disconnect() and omapdss_output_unset_device() functions.
The device state check is now called for every device in the pipeline,
extending this sanity check coverage.

There is no need to return an error from omapdss_device_disconnect()
when the check fails, as omapdss_output_unset_device() used to do, given
that we can't prevent disconnection due to device unbinding (the return
value of omapdss_output_unset_device() is never checked in the current
code for that reason).

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
Laurent Pinchart
2018-03-06 01:51:31 +02:00
committed by Tomi Valkeinen
parent 713165561b
commit 3be0f15bd6
9 changed files with 2 additions and 28 deletions

View File

@@ -24,8 +24,6 @@
#include "dss.h"
#include "omapdss.h"
static DEFINE_MUTEX(output_lock);
int omapdss_output_validate(struct omap_dss_device *out)
{
if (out->next && out->output_type != out->next->type) {
@@ -37,25 +35,6 @@ int omapdss_output_validate(struct omap_dss_device *out)
}
EXPORT_SYMBOL(omapdss_output_validate);
int omapdss_output_unset_device(struct omap_dss_device *out)
{
int r = 0;
mutex_lock(&output_lock);
if (out->dst->state != OMAP_DSS_DISPLAY_DISABLED) {
dev_err(out->dev,
"device %s is not disabled, cannot unset device\n",
out->dst->name);
r = -EINVAL;
}
mutex_unlock(&output_lock);
return r;
}
EXPORT_SYMBOL(omapdss_output_unset_device);
int dss_install_mgr_ops(struct dss_device *dss,
const struct dss_mgr_ops *mgr_ops,
struct omap_drm_private *priv)