From: Jani Nikula <ext-jani.1.nikula@xxxxxxxxx> Avoid problems if panel was disabled while waiting for the mutex. Signed-off-by: Jani Nikula <ext-jani.1.nikula@xxxxxxxxx> --- drivers/video/omap2/displays/panel-taal.c | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index a89b2e7..6abb080 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c @@ -1077,23 +1077,30 @@ static int taal_run_test(struct omap_dss_device *dssdev, int test_num) int r; mutex_lock(&td->lock); + + if (!td->enabled) { + r = -ENODEV; + goto err1; + } + dsi_bus_lock(); r = taal_dcs_read_1(DCS_GET_ID1, &id1); if (r) - goto err; + goto err2; r = taal_dcs_read_1(DCS_GET_ID2, &id2); if (r) - goto err; + goto err2; r = taal_dcs_read_1(DCS_GET_ID3, &id3); if (r) - goto err; + goto err2; dsi_bus_unlock(); mutex_unlock(&td->lock); return 0; -err: +err2: dsi_bus_unlock(); +err1: mutex_unlock(&td->lock); return r; } -- 1.6.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html