drm/sun4i: Move drm_mode_config_cleanup call to main driver
authorChen-Yu Tsai <wens@csie.org>
Fri, 17 Feb 2017 03:13:24 +0000 (11:13 +0800)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Tue, 7 Mar 2017 21:15:14 +0000 (22:15 +0100)
drm_mode_config_cleanup is the complement of drm_mode_config_init, which
is called in the bind function of sun4i_drv. drm_mode_config_cleanup
should be put in the unbind function to match.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/gpu/drm/sun4i/sun4i_drv.c
drivers/gpu/drm/sun4i/sun4i_framebuffer.c

index 9ccf7c4deb6d32e409a39562607abb4f8ed6617e..cd26ed94c41bf69ff1f9a9b380f0686becc4bd6c 100644 (file)
@@ -160,6 +160,7 @@ static void sun4i_drv_unbind(struct device *dev)
        drm_dev_unregister(drm);
        drm_kms_helper_poll_fini(drm);
        sun4i_framebuffer_free(drm);
+       drm_mode_config_cleanup(drm);
        drm_vblank_cleanup(drm);
        drm_dev_unref(drm);
 }
index 2c3beff8b53e2d89de3a6d4e705ae3b9b047ae2f..9872e0fc03b0ec44db0d3ac01c5106ec5d9d426f 100644 (file)
@@ -48,5 +48,4 @@ void sun4i_framebuffer_free(struct drm_device *drm)
        struct sun4i_drv *drv = drm->dev_private;
 
        drm_fbdev_cma_fini(drv->fbdev);
-       drm_mode_config_cleanup(drm);
 }