Skip to content

Commit f574f37

Browse files
dakrdliviu
authored andcommitted
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 <[email protected]> Signed-off-by: Liviu Dudau <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 3ad5103 commit f574f37

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

drivers/gpu/drm/arm/malidp_drv.c

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,9 @@ static int malidp_init(struct drm_device *drm)
396396
struct malidp_drm *malidp = drm_to_malidp(drm);
397397
struct malidp_hw_device *hwdev = malidp->dev;
398398

399-
drm_mode_config_init(drm);
399+
ret = drmm_mode_config_init(drm);
400+
if (ret)
401+
goto out;
400402

401403
drm->mode_config.min_width = hwdev->min_line_size;
402404
drm->mode_config.min_height = hwdev->min_line_size;
@@ -407,24 +409,16 @@ static int malidp_init(struct drm_device *drm)
407409

408410
ret = malidp_crtc_init(drm);
409411
if (ret)
410-
goto crtc_fail;
412+
goto out;
411413

412414
ret = malidp_mw_connector_init(drm);
413415
if (ret)
414-
goto crtc_fail;
415-
416-
return 0;
416+
goto out;
417417

418-
crtc_fail:
419-
drm_mode_config_cleanup(drm);
418+
out:
420419
return ret;
421420
}
422421

423-
static void malidp_fini(struct drm_device *drm)
424-
{
425-
drm_mode_config_cleanup(drm);
426-
}
427-
428422
static int malidp_irq_init(struct platform_device *pdev)
429423
{
430424
int irq_de, irq_se, ret = 0;
@@ -874,7 +868,6 @@ static int malidp_bind(struct device *dev)
874868
bind_fail:
875869
of_node_put(malidp->crtc.port);
876870
malidp->crtc.port = NULL;
877-
malidp_fini(drm);
878871
query_hw_fail:
879872
pm_runtime_put(dev);
880873
if (pm_runtime_enabled(dev))
@@ -902,7 +895,6 @@ static void malidp_unbind(struct device *dev)
902895
component_unbind_all(dev, drm);
903896
of_node_put(malidp->crtc.port);
904897
malidp->crtc.port = NULL;
905-
malidp_fini(drm);
906898
pm_runtime_put(dev);
907899
if (pm_runtime_enabled(dev))
908900
pm_runtime_disable(dev);

0 commit comments

Comments
 (0)