diff options
author | Adrian Salido <salidoa@google.com> | 2023-06-05 23:00:23 -0700 |
---|---|---|
committer | Ken Huang <kenbshuang@google.com> | 2024-01-03 20:30:18 +0800 |
commit | d2b3910bf5d9813b6b6564f6ac51e3bee4025562 (patch) | |
tree | 482886ee1a0e4402b5a3d663c52ecd1abc203d6c | |
parent | 902276e97c32b047aacbfad68c1de5997ac92e85 (diff) | |
download | display-d2b3910bf5d9813b6b6564f6ac51e3bee4025562.tar.gz |
drm: samsung: avoid explicit drm_dev_put during master bind
The component model already releases all devres managed resources
attached to master device. That include the drm_device allocated, so
there is no need for explicitly calling drm_dev_put.
Bug: 275278929
Test: force probe deferral of dsim driver, observe boot logs
Change-Id: I083a1385202f7929742b8e1c7698cc0f0df10e5e
Signed-off-by: Adrian Salido <salidoa@google.com>
(cherry picked from commit c3dbda0c601f6e8c07de063f535c720fa69e0aee)
-rw-r--r-- | samsung/exynos_drm_drv.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/samsung/exynos_drm_drv.c b/samsung/exynos_drm_drv.c index f28fb15..70856b4 100644 --- a/samsung/exynos_drm_drv.c +++ b/samsung/exynos_drm_drv.c @@ -995,10 +995,8 @@ static int exynos_drm_bind(struct device *dev) exynos_drm_connector_create_properties(drm); priv_state = kzalloc(sizeof(*priv_state), GFP_KERNEL); - if (!priv_state) { - ret = -ENOMEM; - goto err_free_drm; - } + if (!priv_state) + return -ENOMEM; priv_state->available_win_mask = BIT(MAX_WIN_PER_DECON) - 1; @@ -1069,8 +1067,6 @@ err_unbind_all: component_unbind_all(dev, drm); err_priv_state_cleanup: drm_atomic_private_obj_fini(&private->obj); -err_free_drm: - drm_dev_put(drm); return ret; } @@ -1092,6 +1088,8 @@ static void exynos_drm_unbind(struct device *dev) component_unbind_all(dev, drm); drm_dev_put(drm); + + dev_set_drvdata(dev, NULL); } static const struct component_master_ops exynos_drm_ops = { @@ -1105,6 +1103,8 @@ static int exynos_drm_platform_probe(struct platform_device *pdev) pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); + platform_set_drvdata(pdev, NULL); + match = exynos_drm_match_add(&pdev->dev); if (IS_ERR(match)) return PTR_ERR(match); @@ -1121,7 +1121,10 @@ static int exynos_drm_platform_remove(struct platform_device *pdev) static void exynos_drm_platform_shutdown(struct platform_device *pdev) { - drm_atomic_helper_shutdown(platform_get_drvdata(pdev)); + struct drm_device *drm_dev = platform_get_drvdata(pdev); + + if (drm_dev) + drm_atomic_helper_shutdown(drm_dev); } static struct platform_driver exynos_drm_platform_driver = { |