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

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

authored by

Anusha Srivatsa and committed by
Maxime Ripard
ae83372b e741c9ff

+5 -5
+5 -5
drivers/gpu/drm/panel/panel-samsung-s6e3fa7.c
··· 185 185 struct s6e3fa7_panel *ctx; 186 186 int ret; 187 187 188 - ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); 189 - if (!ctx) 190 - return -ENOMEM; 188 + ctx = devm_drm_panel_alloc(dev, struct s6e3fa7_panel, panel, 189 + &s6e3fa7_panel_funcs, 190 + DRM_MODE_CONNECTOR_DSI); 191 + if (IS_ERR(ctx)) 192 + return PTR_ERR(ctx); 191 193 192 194 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); 193 195 if (IS_ERR(ctx->reset_gpio)) ··· 204 202 dsi->mode_flags = MIPI_DSI_MODE_VIDEO_BURST | 205 203 MIPI_DSI_CLOCK_NON_CONTINUOUS | MIPI_DSI_MODE_LPM; 206 204 207 - drm_panel_init(&ctx->panel, dev, &s6e3fa7_panel_funcs, 208 - DRM_MODE_CONNECTOR_DSI); 209 205 ctx->panel.prepare_prev_first = true; 210 206 211 207 ctx->panel.backlight = s6e3fa7_panel_create_backlight(dsi);