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

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

authored by

Anusha Srivatsa and committed by
Maxime Ripard
8ee4cf73 11d53df4

+5 -5
+5 -5
drivers/gpu/drm/panel/panel-samsung-ams581vf01.c
··· 211 211 struct ams581vf01 *ctx; 212 212 int ret; 213 213 214 - ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); 215 - if (!ctx) 216 - return -ENOMEM; 214 + ctx = devm_drm_panel_alloc(&dsi->dev, struct ams581vf01, panel, 215 + &ams581vf01_panel_funcs, 216 + DRM_MODE_CONNECTOR_DSI); 217 + if (IS_ERR(ctx)) 218 + return PTR_ERR(ctx); 217 219 218 220 ret = devm_regulator_bulk_get_const(&dsi->dev, 219 221 ARRAY_SIZE(ams581vf01_supplies), ··· 237 235 dsi->mode_flags = MIPI_DSI_MODE_VIDEO_BURST | 238 236 MIPI_DSI_CLOCK_NON_CONTINUOUS | MIPI_DSI_MODE_LPM; 239 237 240 - drm_panel_init(&ctx->panel, dev, &ams581vf01_panel_funcs, 241 - DRM_MODE_CONNECTOR_DSI); 242 238 ctx->panel.prepare_prev_first = true; 243 239 244 240 ctx->panel.backlight = ams581vf01_create_backlight(dsi);