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

Configure Feed

Select the types of activity you want to include in your feed.

drm/panel/kd097d04: Use refcounted allocation in place of devm_kzalloc()

Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.

Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-7-de73ba81b2f5@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>

authored by

Anusha Srivatsa and committed by
Maxime Ripard
6a855c7f daeca2b7

+6 -6
+6 -6
drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c
··· 337 337 kingdisplay->enable_gpio = NULL; 338 338 } 339 339 340 - drm_panel_init(&kingdisplay->base, &kingdisplay->link->dev, 341 - &kingdisplay_panel_funcs, DRM_MODE_CONNECTOR_DSI); 342 - 343 340 err = drm_panel_of_backlight(&kingdisplay->base); 344 341 if (err) 345 342 return err; ··· 361 364 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | 362 365 MIPI_DSI_MODE_LPM; 363 366 364 - kingdisplay = devm_kzalloc(&dsi->dev, sizeof(*kingdisplay), GFP_KERNEL); 365 - if (!kingdisplay) 366 - return -ENOMEM; 367 + kingdisplay = devm_drm_panel_alloc(&dsi->dev, __typeof(*kingdisplay), base, 368 + &kingdisplay_panel_funcs, 369 + DRM_MODE_CONNECTOR_DSI); 370 + 371 + if (IS_ERR(kingdisplay)) 372 + return PTR_ERR(kingdisplay); 367 373 368 374 mipi_dsi_set_drvdata(dsi, kingdisplay); 369 375 kingdisplay->link = dsi;