diff options
author | Alan Cox <alan@linux.intel.com> | 2012-05-14 11:04:00 (GMT) |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-05-17 10:05:30 (GMT) |
commit | 4ab2c7f15423f313187b310a48ee0ac631c414f1 (patch) | |
tree | 41844429f95ed794a8b513beee8cf3a7d442d656 /drivers/gpu/drm/gma500/framebuffer.c | |
parent | 6607e024014e4920e8d3e43bcfeec0436d43d980 (diff) | |
download | linux-fsl-qoriq-4ab2c7f15423f313187b310a48ee0ac631c414f1.tar.xz |
gma500: unload fixes
Debugging the lid problem tested various error paths which were found
wanting so start fixing them up.
There is a ton of improvement work could be done here so that every bit
of functionality agrees if its _fini, _uninit, etc, and they agree who
is responsible for deciding if the clean up is needed.
That can come later.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/gma500/framebuffer.c')
-rw-r--r-- | drivers/gpu/drm/gma500/framebuffer.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index 659ed39..8d77224 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c @@ -800,15 +800,20 @@ void psb_modeset_init(struct drm_device *dev) if (dev_priv->ops->errata) dev_priv->ops->errata(dev); + + dev_priv->modeset = true; } void psb_modeset_cleanup(struct drm_device *dev) { - mutex_lock(&dev->struct_mutex); + struct drm_psb_private *dev_priv = dev->dev_private; + if (dev_priv->modeset) { + mutex_lock(&dev->struct_mutex); - drm_kms_helper_poll_fini(dev); - psb_fbdev_fini(dev); - drm_mode_config_cleanup(dev); + drm_kms_helper_poll_fini(dev); + psb_fbdev_fini(dev); + drm_mode_config_cleanup(dev); - mutex_unlock(&dev->struct_mutex); + mutex_unlock(&dev->struct_mutex); + } } |