[PATCH v2 2/5] drm/panel: panel-simple: make panel_dpi_probe return a panel_desc
Javier Martinez Canillas
javierm at redhat.com
Fri Jun 27 09:06:30 UTC 2025
Maxime Ripard <mripard at kernel.org> writes:
> If the panel-simple driver is probed from a panel-dpi compatible, the
> driver will use an empty panel_desc structure as a descriminant. It
> will then allocate and fill another panel_desc as part of its probe.
>
> However, that allocation needs to happen after the panel_simple
> structure has been allocated, since panel_dpi_probe(), the function
> doing the panel_desc allocation and initialization, takes a panel_simple
> pointer as an argument.
>
> This pointer is used to fill the panel_simple->desc pointer that is
> still initialized with the empty panel_desc when panel_dpi_probe() is
> called.
>
> Since commit de04bb0089a9 ("drm/panel/panel-simple: Use the new
> allocation in place of devm_kzalloc()"), we will need the panel
> connector type found in panel_desc to allocate panel_simple. This
> creates a circular dependency where we need panel_desc to create
> panel_simple, and need panel_simple to create panel_desc.
>
> Let's break that dependency by making panel_dpi_probe simply return the
> panel_desc it initialized and move the panel_simple->desc assignment to
> the caller.
>
> This will not fix the breaking commit entirely, but will move us towards
> the right direction.
>
> Fixes: de04bb0089a9 ("drm/panel/panel-simple: Use the new allocation in place of devm_kzalloc()")
> Signed-off-by: Maxime Ripard <mripard at kernel.org>
> ---
Reviewed-by: Javier Martinez Canillas <javierm at redhat.com>
--
Best regards,
Javier Martinez Canillas
Core Platforms
Red Hat
More information about the dri-devel
mailing list