Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7c1aecd authored by Tomi Valkeinen's avatar Tomi Valkeinen
Browse files

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: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent f7c5f5d9
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -530,6 +530,7 @@ static int dev_unload(struct drm_device *dev)

	drm_kms_helper_poll_fini(dev);

	if (priv->fbdev)
		omap_fbdev_free(dev);

	/* flush crtcs so the fbs get released */
@@ -599,10 +600,12 @@ static void dev_lastclose(struct drm_device *dev)
		}
	}

	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)
{