drm/exynos: added postclose to release resource.
authorInki Dae <inki.dae@samsung.com>
Wed, 15 Feb 2012 02:25:22 +0000 (11:25 +0900)
committerDave Airlie <airlied@redhat.com>
Thu, 16 Feb 2012 09:40:54 +0000 (09:40 +0000)
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/exynos/exynos_drm_drv.c

index 76a111f54ccb090965abb32a5c9713bdbbb9a0e2..58820ebd35588f8b1e493234022b0e2132996369 100644 (file)
@@ -151,6 +151,17 @@ static void exynos_drm_preclose(struct drm_device *dev,
 
 }
 
+static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
+{
+       DRM_DEBUG_DRIVER("%s\n", __FILE__);
+
+       if (!file->driver_priv)
+               return;
+
+       kfree(file->driver_priv);
+       file->driver_priv = NULL;
+}
+
 static void exynos_drm_lastclose(struct drm_device *dev)
 {
        DRM_DEBUG_DRIVER("%s\n", __FILE__);
@@ -193,6 +204,7 @@ static struct drm_driver exynos_drm_driver = {
        .unload                 = exynos_drm_unload,
        .preclose               = exynos_drm_preclose,
        .lastclose              = exynos_drm_lastclose,
+       .postclose              = exynos_drm_postclose,
        .get_vblank_counter     = drm_vblank_count,
        .enable_vblank          = exynos_drm_crtc_enable_vblank,
        .disable_vblank         = exynos_drm_crtc_disable_vblank,