diff options
author | Jyri Sarha <jsarha@ti.com> | 2016-10-18 23:23:27 +0300 |
---|---|---|
committer | Jyri Sarha <jsarha@ti.com> | 2016-11-29 21:03:19 +0200 |
commit | 9e79e062dc9b3aed541d6e47ac178aff815ab0e8 (patch) | |
tree | 18af796c4c0ea88b9810b6ffae7642c528b6014b /drivers/gpu/drm/tilcdc/tilcdc_crtc.c | |
parent | 923310ba73d742450bb41bb017cb1b6704bd32b5 (diff) | |
download | op-kernel-dev-9e79e062dc9b3aed541d6e47ac178aff815ab0e8.zip op-kernel-dev-9e79e062dc9b3aed541d6e47ac178aff815ab0e8.tar.gz |
drm/tilcdc: Use unload to handle initialization failures
Use unload to handle initialization failures instead of complex goto
label mess. To do this the initialization sequence needed slight
reordering and some unload functions needed to become conditional.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Diffstat (limited to 'drivers/gpu/drm/tilcdc/tilcdc_crtc.c')
-rw-r--r-- | drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c index ea79e09..6277363 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c @@ -177,14 +177,12 @@ static void tilcdc_crtc_enable(struct drm_crtc *crtc) tilcdc_crtc->enabled = true; } -void tilcdc_crtc_disable(struct drm_crtc *crtc) +void tilcdc_crtc_off(struct drm_crtc *crtc) { struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); struct drm_device *dev = crtc->dev; struct tilcdc_drm_private *priv = dev->dev_private; - WARN_ON(!drm_modeset_is_locked(&crtc->mutex)); - if (!tilcdc_crtc->enabled) return; @@ -228,6 +226,12 @@ void tilcdc_crtc_disable(struct drm_crtc *crtc) tilcdc_crtc->enabled = false; } +static void tilcdc_crtc_disable(struct drm_crtc *crtc) +{ + WARN_ON(!drm_modeset_is_locked(&crtc->mutex)); + tilcdc_crtc_off(crtc); +} + static bool tilcdc_crtc_is_on(struct drm_crtc *crtc) { return crtc->state && crtc->state->enable && crtc->state->active; |