[PATCH 1/3] drm/i915/display: allocate struct intel_display dynamically
Lucas De Marchi
lucas.demarchi at intel.com
Wed May 21 15:33:52 UTC 2025
On Wed, May 21, 2025 at 01:21:46PM +0300, Jani Nikula wrote:
>diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
>index 1e59b6dd2c3b..e3e5d41db29d 100644
>--- a/drivers/gpu/drm/xe/display/xe_display.c
>+++ b/drivers/gpu/drm/xe/display/xe_display.c
>@@ -529,14 +529,17 @@ int xe_display_probe(struct xe_device *xe)
> if (!xe->info.probe_display)
> goto no_display;
>
>- /* TODO: Allocate display dynamically. */
>- xe->display = &xe->__display;
>-
> display = intel_display_device_probe(pdev);
>+ if (IS_ERR(display))
>+ return PTR_ERR(display);
>
> err = drmm_add_action_or_reset(&xe->drm, display_device_remove, display);
>- if (err)
>+ if (err) {
>+ intel_display_device_remove(display);
_or_reset() means that if there's a failure adding the action it will
call the cb, so intel_display_device_remove() was already
called at this point. Just return err.
Other than that, lgtm. Reviewed-by: Lucas De Marchi <lucas.demarchi at intel.com>
Lucas De Marchi
More information about the Intel-gfx
mailing list