drm/panel/sharp-ls043t1le01: Use refcounted allocation in place of devm_kzalloc()

Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Albert Esteve <aesteve@redhat.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260508-drm_panel_init_rm-v2-7-0bd4ac429971@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
Albert Esteve 2026-05-08 09:04:47 +02:00 committed by Maxime Ripard
parent 928decbed7
commit c02427a772
No known key found for this signature in database
GPG Key ID: 275FCE19A23DBE76

View File

@ -199,8 +199,6 @@ static int sharp_nt_panel_add(struct sharp_nt_panel *sharp_nt)
gpiod_set_value(sharp_nt->reset_gpio, 0);
}
drm_panel_init(&sharp_nt->base, &sharp_nt->dsi->dev,
&sharp_nt_panel_funcs, DRM_MODE_CONNECTOR_DSI);
sharp_nt->base.prepare_prev_first = true;
ret = drm_panel_of_backlight(&sharp_nt->base);
@ -231,9 +229,12 @@ static int sharp_nt_panel_probe(struct mipi_dsi_device *dsi)
MIPI_DSI_CLOCK_NON_CONTINUOUS |
MIPI_DSI_MODE_NO_EOT_PACKET;
sharp_nt = devm_kzalloc(&dsi->dev, sizeof(*sharp_nt), GFP_KERNEL);
if (!sharp_nt)
return -ENOMEM;
sharp_nt = devm_drm_panel_alloc(&dsi->dev, __typeof(*sharp_nt), base,
&sharp_nt_panel_funcs,
DRM_MODE_CONNECTOR_DSI);
if (IS_ERR(sharp_nt))
return PTR_ERR(sharp_nt);
mipi_dsi_set_drvdata(dsi, sharp_nt);