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

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 <dakr@redhat.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221026153431.72033-5-dakr@redhat.com

authored by

Danilo Krummrich and committed by
Liviu Dudau
611fc22c 8aa20195

+13 -6
+13 -6
drivers/gpu/drm/arm/hdlcd_drv.c
··· 175 175 .atomic_commit = drm_atomic_helper_commit, 176 176 }; 177 177 178 - static void hdlcd_setup_mode_config(struct drm_device *drm) 178 + static int hdlcd_setup_mode_config(struct drm_device *drm) 179 179 { 180 - drm_mode_config_init(drm); 180 + int ret; 181 + 182 + ret = drmm_mode_config_init(drm); 183 + if (ret) 184 + return ret; 185 + 181 186 drm->mode_config.min_width = 0; 182 187 drm->mode_config.min_height = 0; 183 188 drm->mode_config.max_width = HDLCD_MAX_XRES; 184 189 drm->mode_config.max_height = HDLCD_MAX_YRES; 185 190 drm->mode_config.funcs = &hdlcd_mode_config_funcs; 191 + 192 + return 0; 186 193 } 187 194 188 195 #ifdef CONFIG_DEBUG_FS ··· 262 255 263 256 dev_set_drvdata(dev, drm); 264 257 265 - hdlcd_setup_mode_config(drm); 258 + ret = hdlcd_setup_mode_config(drm); 259 + if (ret) 260 + goto err_free; 261 + 266 262 ret = hdlcd_load(drm, 0); 267 263 if (ret) 268 264 goto err_free; ··· 324 314 hdlcd_irq_uninstall(hdlcd); 325 315 of_reserved_mem_device_release(drm->dev); 326 316 err_free: 327 - drm_mode_config_cleanup(drm); 328 317 dev_set_drvdata(dev, NULL); 329 - 330 318 return ret; 331 319 } 332 320 ··· 345 337 if (pm_runtime_enabled(dev)) 346 338 pm_runtime_disable(dev); 347 339 of_reserved_mem_device_release(dev); 348 - drm_mode_config_cleanup(drm); 349 340 dev_set_drvdata(dev, NULL); 350 341 } 351 342