Skip to content

Commit 611fc22

Browse files
dakrdliviu
authored andcommitted
drm/arm/hdlcd: 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 8aa2019 commit 611fc22

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

drivers/gpu/drm/arm/hdlcd_drv.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,21 @@ static const struct drm_mode_config_funcs hdlcd_mode_config_funcs = {
175175
.atomic_commit = drm_atomic_helper_commit,
176176
};
177177

178-
static void hdlcd_setup_mode_config(struct drm_device *drm)
178+
static int hdlcd_setup_mode_config(struct drm_device *drm)
179179
{
180-
drm_mode_config_init(drm);
180+
int ret;
181+
182+
ret = drmm_mode_config_init(drm);
183+
if (ret)
184+
return ret;
185+
181186
drm->mode_config.min_width = 0;
182187
drm->mode_config.min_height = 0;
183188
drm->mode_config.max_width = HDLCD_MAX_XRES;
184189
drm->mode_config.max_height = HDLCD_MAX_YRES;
185190
drm->mode_config.funcs = &hdlcd_mode_config_funcs;
191+
192+
return 0;
186193
}
187194

188195
#ifdef CONFIG_DEBUG_FS
@@ -255,7 +262,10 @@ static int hdlcd_drm_bind(struct device *dev)
255262

256263
dev_set_drvdata(dev, drm);
257264

258-
hdlcd_setup_mode_config(drm);
265+
ret = hdlcd_setup_mode_config(drm);
266+
if (ret)
267+
goto err_free;
268+
259269
ret = hdlcd_load(drm, 0);
260270
if (ret)
261271
goto err_free;
@@ -314,9 +324,7 @@ static int hdlcd_drm_bind(struct device *dev)
314324
hdlcd_irq_uninstall(hdlcd);
315325
of_reserved_mem_device_release(drm->dev);
316326
err_free:
317-
drm_mode_config_cleanup(drm);
318327
dev_set_drvdata(dev, NULL);
319-
320328
return ret;
321329
}
322330

@@ -337,7 +345,6 @@ static void hdlcd_drm_unbind(struct device *dev)
337345
if (pm_runtime_enabled(dev))
338346
pm_runtime_disable(dev);
339347
of_reserved_mem_device_release(dev);
340-
drm_mode_config_cleanup(drm);
341348
dev_set_drvdata(dev, NULL);
342349
}
343350

0 commit comments

Comments
 (0)