Commit 643231b2 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/fbdev-generic: Minimize hotplug error handling

Call drm_fb_helper_fini() in the generic-fbdev hotplug helper
to revert the effects of drm_fb_helper_init(). No full cleanup
is required.

v3:
	* fix error in commit message (Javier)
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230125200415.14123-8-tzimmermann@suse.de
parent 6c80a93b
...@@ -387,25 +387,21 @@ static int drm_fbdev_client_hotplug(struct drm_client_dev *client) ...@@ -387,25 +387,21 @@ static int drm_fbdev_client_hotplug(struct drm_client_dev *client)
ret = drm_fb_helper_init(dev, fb_helper); ret = drm_fb_helper_init(dev, fb_helper);
if (ret) if (ret)
goto err; goto err_drm_err;
if (!drm_drv_uses_atomic_modeset(dev)) if (!drm_drv_uses_atomic_modeset(dev))
drm_helper_disable_unused_functions(dev); drm_helper_disable_unused_functions(dev);
ret = drm_fb_helper_initial_config(fb_helper); ret = drm_fb_helper_initial_config(fb_helper);
if (ret) if (ret)
goto err_cleanup; goto err_drm_fb_helper_fini;
return 0; return 0;
err_cleanup: err_drm_fb_helper_fini:
drm_fbdev_cleanup(fb_helper); drm_fb_helper_fini(fb_helper);
err: err_drm_err:
fb_helper->dev = NULL;
fb_helper->info = NULL;
drm_err(dev, "fbdev: Failed to setup generic emulation (ret=%d)\n", ret); drm_err(dev, "fbdev: Failed to setup generic emulation (ret=%d)\n", ret);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment