Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Move to using the new API devm_drm_panel_alloc() to allocate the
panel.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
Link: https://lore.kernel.org/r/20250529-b4-drm_panel_mass_driver_convert_part3-v2-25-5d75a3711e40@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>

authored by

Anusha Srivatsa and committed by
Maxime Ripard
066e3df8 c32cd7f7

+5 -6
+5 -6
drivers/gpu/drm/panel/panel-sharp-ls060t1sx01.c
··· 193 193 struct sharp_ls060 *ctx; 194 194 int ret; 195 195 196 - ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); 197 - if (!ctx) 198 - return -ENOMEM; 196 + ctx = devm_drm_panel_alloc(dev, struct sharp_ls060, panel, 197 + &sharp_ls060_panel_funcs, 198 + DRM_MODE_CONNECTOR_DSI); 199 + if (IS_ERR(ctx)) 200 + return PTR_ERR(ctx); 199 201 200 202 ctx->vddi_supply = devm_regulator_get(dev, "vddi"); 201 203 if (IS_ERR(ctx->vddi_supply)) ··· 228 226 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | 229 227 MIPI_DSI_MODE_NO_EOT_PACKET | 230 228 MIPI_DSI_CLOCK_NON_CONTINUOUS; 231 - 232 - drm_panel_init(&ctx->panel, dev, &sharp_ls060_panel_funcs, 233 - DRM_MODE_CONNECTOR_DSI); 234 229 235 230 ret = drm_panel_of_backlight(&ctx->panel); 236 231 if (ret)