[PATCH v2 3/5] drm/panel: panel-simple: Make panel_simple_probe return its panel
Javier Martinez Canillas
javierm at redhat.com
Fri Jun 27 09:10:53 UTC 2025
Maxime Ripard <mripard at kernel.org> writes:
> In order to fix the regession introduced by commit de04bb0089a9
> ("drm/panel/panel-simple: Use the new allocation in place of
> devm_kzalloc()"), we need to move the panel_desc lookup into the common
> panel_simple_probe() function.
>
> There's two callers for that function, the probe implementations of the
> platform and MIPI-DSI drivers panel-simple implements.
>
> The MIPI-DSI driver's probe will need to access the current panel_desc
> to initialize properly, which won't be possible anymore if we make that
> lookup in panel_simple_probe().
>
> However, we can make panel_simple_probe() return the initialized
> panel_simple structure it allocated, which will contain a pointer to the
> associated panel_desc in its desc field.
>
> This doesn't fix de04bb0089a9 ("drm/panel/panel-simple: Use the new
> allocation in place of devm_kzalloc()") still, but makes progress
> towards that goal.
>
> Fixes: de04bb0089a9 ("drm/panel/panel-simple: Use the new allocation in place of devm_kzalloc()")
> Signed-off-by: Maxime Ripard <mripard at kernel.org>
> ---
[...]
> -static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
> +static struct panel_simple *panel_simple_probe(struct device *dev, const struct panel_desc *desc)
> {
[...]
>
> ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
> if (ddc) {
> panel->ddc = of_find_i2c_adapter_by_node(ddc);
> of_node_put(ddc);
>
> if (!panel->ddc)
> - return -EPROBE_DEFER;
> + return ERR_PTR(-EPROBE_DEFER);
Not related with your patch, but it would be great to also add a
dev_err_probe() here to record the reason of this probe deferral.
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