drm/radeon: Correctly clean up failed display probing
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 16 Mar 2023 09:37:36 +0000 (10:37 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 31 Mar 2023 15:18:42 +0000 (11:18 -0400)
commit3a745f6ac13216f85c3804654f4c703995c17180
treeef87abb450abb7d8ef47f4723f3716bd1a68cf2d
parent62bb839d48ae87d6aa07259ff6bc8d049538d1f2
drm/radeon: Correctly clean up failed display probing

Improve the fbdev probing function to fully clean up if it failed.
Allows to remove special cases from fb_destroy as well.

This change is reorders the operations within radeonfb_probe(). It
first allocates a buffer object, then builds a DRM framebuffer for
the object and finally creates the fbdev device. If every step
succeeded, the probe function clears the framebuffer memory. This
is the optimal order to rollback any changes if any of the steps
fails.

No functional changes.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_fb.c