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

panel/panel-elida-kd35t133: 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/20250520-drivers-mass-convert-part2-v3-1-f7ae7b723c68@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>

authored by

Anusha Srivatsa and committed by
Maxime Ripard
74ca3ba0 ae01d318

+4 -6
+4 -6
drivers/gpu/drm/panel/panel-elida-kd35t133.c
··· 206 206 struct kd35t133 *ctx; 207 207 int ret; 208 208 209 - ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); 210 - if (!ctx) 211 - return -ENOMEM; 209 + ctx = devm_drm_panel_alloc(dev, struct kd35t133, panel, 210 + &kd35t133_funcs, DRM_MODE_CONNECTOR_DSI); 211 + if (IS_ERR(ctx)) 212 + return PTR_ERR(ctx); 212 213 213 214 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); 214 215 if (IS_ERR(ctx->reset_gpio)) { ··· 248 247 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | 249 248 MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET | 250 249 MIPI_DSI_CLOCK_NON_CONTINUOUS; 251 - 252 - drm_panel_init(&ctx->panel, &dsi->dev, &kd35t133_funcs, 253 - DRM_MODE_CONNECTOR_DSI); 254 250 255 251 ret = drm_panel_of_backlight(&ctx->panel); 256 252 if (ret)