Switch mode-config initialization to drmm_mode_config_init() so that the
lifetime is tied to drm_device. Remove explicit drm_mode_config_cleanup()
from error and unbind paths since cleanup is now managed by DRM.

No functional change intended.

Signed-off-by: Hoyoung Lee <hy_fifty....@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 6cc7bf77bcac..1aea71778ab1 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -257,7 +257,7 @@ static int exynos_drm_bind(struct device *dev)
        dev_set_drvdata(dev, drm);
        drm->dev_private = (void *)private;
 
-       drm_mode_config_init(drm);
+       drmm_mode_config_init(drm);
 
        exynos_drm_mode_config_init(drm);
 
@@ -297,7 +297,6 @@ static int exynos_drm_bind(struct device *dev)
 err_unbind_all:
        component_unbind_all(drm->dev, drm);
 err_mode_config_cleanup:
-       drm_mode_config_cleanup(drm);
        exynos_drm_cleanup_dma(drm);
        kfree(private);
        dev_set_drvdata(dev, NULL);
@@ -317,7 +316,6 @@ static void exynos_drm_unbind(struct device *dev)
        drm_atomic_helper_shutdown(drm);
 
        component_unbind_all(drm->dev, drm);
-       drm_mode_config_cleanup(drm);
        exynos_drm_cleanup_dma(drm);
 
        kfree(drm->dev_private);
-- 
2.34.1

Reply via email to