Skip to content

Commit 46c8779

Browse files
anushasrivatsmripard
authored andcommitted
drm/panel/himax-hx83102: 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 <[email protected]> Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-12-de73ba81b2f5@redhat.com Signed-off-by: Maxime Ripard <[email protected]>
1 parent ea8642f commit 46c8779

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/gpu/drm/panel/panel-himax-hx83102.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -989,8 +989,6 @@ static int hx83102_panel_add(struct hx83102 *ctx)
989989

990990
ctx->base.prepare_prev_first = true;
991991

992-
drm_panel_init(&ctx->base, dev, &hx83102_drm_funcs,
993-
DRM_MODE_CONNECTOR_DSI);
994992
err = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation);
995993
if (err < 0)
996994
return dev_err_probe(dev, err, "failed to get orientation\n");
@@ -1013,9 +1011,11 @@ static int hx83102_probe(struct mipi_dsi_device *dsi)
10131011
int ret;
10141012
const struct hx83102_panel_desc *desc;
10151013

1016-
ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL);
1017-
if (!ctx)
1018-
return -ENOMEM;
1014+
ctx = devm_drm_panel_alloc(&dsi->dev, __typeof(*ctx), base,
1015+
&hx83102_drm_funcs, DRM_MODE_CONNECTOR_DSI);
1016+
1017+
if (IS_ERR(ctx))
1018+
return PTR_ERR(ctx);
10191019

10201020
desc = of_device_get_match_data(&dsi->dev);
10211021
dsi->lanes = 4;

0 commit comments

Comments
 (0)