diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-09-25 19:24:26 +0000 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2015-03-24 13:50:54 +0200 |
commit | c7c1aecd8e490c3818eaaea33e3c0d372931350a (patch) | |
tree | 12e2025df09c2e28fdef998ead56801543e5613f /drivers/gpu/drm/omapdrm | |
parent | f7c5f5d9e25dc524f1cdc6cf821400ac29dae486 (diff) | |
download | linux-c7c1aecd8e490c3818eaaea33e3c0d372931350a.tar.bz2 |
drm/omap: fix operation without fbdev
omapdrm should work fine even if fbdev is missing. The current driver
crashes in that case, though, as it is missing checks for the fbdev.
Add the checks so that we don't free fbdev or restore fbdev mode when
there's no fbdev.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_drv.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index b71a443e671e..63c953971c11 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -530,7 +530,8 @@ static int dev_unload(struct drm_device *dev) drm_kms_helper_poll_fini(dev); - omap_fbdev_free(dev); + if (priv->fbdev) + omap_fbdev_free(dev); /* flush crtcs so the fbs get released */ for (i = 0; i < priv->num_crtcs; i++) @@ -599,9 +600,11 @@ static void dev_lastclose(struct drm_device *dev) } } - ret = drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev); - if (ret) - DBG("failed to restore crtc mode"); + if (priv->fbdev) { + ret = drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev); + if (ret) + DBG("failed to restore crtc mode"); + } } static void dev_preclose(struct drm_device *dev, struct drm_file *file) |