mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
drm/panel/vvx10f034n00: 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-3-de73ba81b2f5@redhat.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
committed by
Maxime Ripard
parent
6299cb4a21
commit
8e4e733d95
@@ -166,9 +166,6 @@ static int wuxga_nt_panel_add(struct wuxga_nt_panel *wuxga_nt)
|
||||
if (IS_ERR(wuxga_nt->supply))
|
||||
return PTR_ERR(wuxga_nt->supply);
|
||||
|
||||
drm_panel_init(&wuxga_nt->base, &wuxga_nt->dsi->dev,
|
||||
&wuxga_nt_panel_funcs, DRM_MODE_CONNECTOR_DSI);
|
||||
|
||||
ret = drm_panel_of_backlight(&wuxga_nt->base);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -196,9 +193,12 @@ static int wuxga_nt_panel_probe(struct mipi_dsi_device *dsi)
|
||||
MIPI_DSI_CLOCK_NON_CONTINUOUS |
|
||||
MIPI_DSI_MODE_LPM;
|
||||
|
||||
wuxga_nt = devm_kzalloc(&dsi->dev, sizeof(*wuxga_nt), GFP_KERNEL);
|
||||
if (!wuxga_nt)
|
||||
return -ENOMEM;
|
||||
wuxga_nt = devm_drm_panel_alloc(&dsi->dev, __typeof(*wuxga_nt), base,
|
||||
&wuxga_nt_panel_funcs,
|
||||
DRM_MODE_CONNECTOR_DSI);
|
||||
|
||||
if (IS_ERR(wuxga_nt))
|
||||
return PTR_ERR(wuxga_nt);
|
||||
|
||||
mipi_dsi_set_drvdata(dsi, wuxga_nt);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user