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

panel/samsung-s6d7aa0: 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-15-5d75a3711e40@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>

authored by

Anusha Srivatsa and committed by
Maxime Ripard
e741c9ff 532d4c33

+5 -5
+5 -5
drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c
··· 392 392 struct s6d7aa0 *ctx; 393 393 int ret; 394 394 395 - ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); 396 - if (!ctx) 397 - return -ENOMEM; 395 + ctx = devm_drm_panel_alloc(dev, struct s6d7aa0, panel, 396 + &s6d7aa0_panel_funcs, 397 + DRM_MODE_CONNECTOR_DSI); 398 + if (IS_ERR(ctx)) 399 + return PTR_ERR(ctx); 398 400 399 401 ctx->desc = of_device_get_match_data(dev); 400 402 if (!ctx->desc) ··· 422 420 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST 423 421 | ctx->desc->mode_flags; 424 422 425 - drm_panel_init(&ctx->panel, dev, &s6d7aa0_panel_funcs, 426 - DRM_MODE_CONNECTOR_DSI); 427 423 ctx->panel.prepare_prev_first = true; 428 424 429 425 ret = drm_panel_of_backlight(&ctx->panel);