Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/arm/malidp: remove calls to drm_mode_config_cleanup()

drm_mode_config_init() simply calls drmm_mode_config_init(), hence
cleanup is automatically handled through registering
drm_mode_config_cleanup() with drmm_add_action_or_reset().

While at it, get rid of the deprecated drm_mode_config_init() and
replace it with drmm_mode_config_init() directly.

Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221026155934.125294-6-dakr@redhat.com

authored by

Danilo Krummrich and committed by
Liviu Dudau
f574f377 3ad51034

+6 -14
+6 -14
drivers/gpu/drm/arm/malidp_drv.c
··· 396 396 struct malidp_drm *malidp = drm_to_malidp(drm); 397 397 struct malidp_hw_device *hwdev = malidp->dev; 398 398 399 - drm_mode_config_init(drm); 399 + ret = drmm_mode_config_init(drm); 400 + if (ret) 401 + goto out; 400 402 401 403 drm->mode_config.min_width = hwdev->min_line_size; 402 404 drm->mode_config.min_height = hwdev->min_line_size; ··· 409 407 410 408 ret = malidp_crtc_init(drm); 411 409 if (ret) 412 - goto crtc_fail; 410 + goto out; 413 411 414 412 ret = malidp_mw_connector_init(drm); 415 413 if (ret) 416 - goto crtc_fail; 414 + goto out; 417 415 418 - return 0; 419 - 420 - crtc_fail: 421 - drm_mode_config_cleanup(drm); 416 + out: 422 417 return ret; 423 - } 424 - 425 - static void malidp_fini(struct drm_device *drm) 426 - { 427 - drm_mode_config_cleanup(drm); 428 418 } 429 419 430 420 static int malidp_irq_init(struct platform_device *pdev) ··· 868 874 bind_fail: 869 875 of_node_put(malidp->crtc.port); 870 876 malidp->crtc.port = NULL; 871 - malidp_fini(drm); 872 877 query_hw_fail: 873 878 pm_runtime_put(dev); 874 879 if (pm_runtime_enabled(dev)) ··· 895 902 component_unbind_all(dev, drm); 896 903 of_node_put(malidp->crtc.port); 897 904 malidp->crtc.port = NULL; 898 - malidp_fini(drm); 899 905 pm_runtime_put(dev); 900 906 if (pm_runtime_enabled(dev)) 901 907 pm_runtime_disable(dev);