Skip to content

Commit

Permalink
OMAPDSS: check the return value of dss_mgr_enable()
Browse files Browse the repository at this point in the history
Now that dss_mgr_enable returns an error value, check it in all the
places dss_mgr_enable is used, and bail out properly.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
  • Loading branch information
Tomi Valkeinen committed Dec 2, 2011
1 parent 2a4ee7e commit 33ca237
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 7 deletions.
5 changes: 4 additions & 1 deletion drivers/video/omap2/dss/dpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,13 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)

mdelay(2);

dss_mgr_enable(dssdev->manager);
r = dss_mgr_enable(dssdev->manager);
if (r)
goto err_mgr_enable;

return 0;

err_mgr_enable:
err_set_mode:
if (dpi_use_dsi_pll(dssdev))
dsi_pll_uninit(dpi.dsidev, true);
Expand Down
11 changes: 10 additions & 1 deletion drivers/video/omap2/dss/dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3979,6 +3979,7 @@ int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel)
int bpp = dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt);
u8 data_type;
u16 word_count;
int r;

if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_VIDEO_MODE) {
switch (dssdev->panel.dsi_pix_fmt) {
Expand Down Expand Up @@ -4013,7 +4014,15 @@ int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel)
dsi_if_enable(dsidev, true);
}

dss_mgr_enable(dssdev->manager);
r = dss_mgr_enable(dssdev->manager);
if (r) {
if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_VIDEO_MODE) {
dsi_if_enable(dsidev, false);
dsi_vc_enable(dsidev, channel, false);
}

return r;
}

return 0;
}
Expand Down
9 changes: 8 additions & 1 deletion drivers/video/omap2/dss/hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,16 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)

hdmi.ip_data.ops->video_enable(&hdmi.ip_data, 1);

dss_mgr_enable(dssdev->manager);
r = dss_mgr_enable(dssdev->manager);
if (r)
goto err_mgr_enable;

return 0;

err_mgr_enable:
hdmi.ip_data.ops->video_enable(&hdmi.ip_data, 0);
hdmi.ip_data.ops->phy_disable(&hdmi.ip_data);
hdmi.ip_data.ops->pll_disable(&hdmi.ip_data);
err:
hdmi_runtime_put();
return -EIO;
Expand Down
6 changes: 5 additions & 1 deletion drivers/video/omap2/dss/sdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,14 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
goto err_sdi_enable;
mdelay(2);

dss_mgr_enable(dssdev->manager);
r = dss_mgr_enable(dssdev->manager);
if (r)
goto err_mgr_enable;

return 0;

err_mgr_enable:
dss_sdi_disable();
err_sdi_enable:
err_set_dispc_clock_div:
err_set_dss_clock_div:
Expand Down
26 changes: 23 additions & 3 deletions drivers/video/omap2/dss/venc.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,10 @@ static const struct venc_config *venc_timings_to_config(
BUG();
}

static void venc_power_on(struct omap_dss_device *dssdev)
static int venc_power_on(struct omap_dss_device *dssdev)
{
u32 l;
int r;

venc_reset();
venc_write_config(venc_timings_to_config(&dssdev->panel.timings));
Expand Down Expand Up @@ -447,7 +448,22 @@ static void venc_power_on(struct omap_dss_device *dssdev)
if (dssdev->platform_enable)
dssdev->platform_enable(dssdev);

dss_mgr_enable(dssdev->manager);
r = dss_mgr_enable(dssdev->manager);
if (r)
goto err;

return 0;

err:
venc_write_reg(VENC_OUTPUT_CONTROL, 0);
dss_set_dac_pwrdn_bgz(0);

if (dssdev->platform_disable)
dssdev->platform_disable(dssdev);

regulator_disable(venc.vdda_dac_reg);

return r;
}

static void venc_power_off(struct omap_dss_device *dssdev)
Expand Down Expand Up @@ -504,14 +520,18 @@ static int venc_panel_enable(struct omap_dss_device *dssdev)
if (r)
goto err1;

venc_power_on(dssdev);
r = venc_power_on(dssdev);
if (r)
goto err2;

venc.wss_data = 0;

dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;

mutex_unlock(&venc.venc_lock);
return 0;
err2:
venc_runtime_put();
err1:
omap_dss_stop_device(dssdev);
err0:
Expand Down

0 comments on commit 33ca237

Please sign in to comment.