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

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

authored by

Anusha Srivatsa and committed by
Maxime Ripard
20291d8f 8720c9b5

+5 -6
+5 -6
drivers/gpu/drm/panel/panel-raydium-rm68200.c
··· 327 327 struct rm68200 *ctx; 328 328 int ret; 329 329 330 - ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); 331 - if (!ctx) 332 - return -ENOMEM; 330 + ctx = devm_drm_panel_alloc(dev, struct rm68200, panel, 331 + &rm68200_drm_funcs, 332 + DRM_MODE_CONNECTOR_DSI); 333 + if (IS_ERR(ctx)) 334 + return PTR_ERR(ctx); 333 335 334 336 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); 335 337 if (IS_ERR(ctx->reset_gpio)) { ··· 356 354 dsi->format = MIPI_DSI_FMT_RGB888; 357 355 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | 358 356 MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS; 359 - 360 - drm_panel_init(&ctx->panel, dev, &rm68200_drm_funcs, 361 - DRM_MODE_CONNECTOR_DSI); 362 357 363 358 ret = drm_panel_of_backlight(&ctx->panel); 364 359 if (ret)