Skip to content

Commit 51929b6

Browse files
anushasrivatsmripard
authored andcommitted
drm/panel/boe-tv101wum-nl6: 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-13-de73ba81b2f5@redhat.com Signed-off-by: Maxime Ripard <[email protected]>
1 parent 46c8779 commit 51929b6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,8 +1720,6 @@ static int boe_panel_add(struct boe_panel *boe)
17201720

17211721
boe->base.prepare_prev_first = true;
17221722

1723-
drm_panel_init(&boe->base, dev, &boe_panel_funcs,
1724-
DRM_MODE_CONNECTOR_DSI);
17251723
err = of_drm_get_panel_orientation(dev->of_node, &boe->orientation);
17261724
if (err < 0) {
17271725
dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err);
@@ -1746,9 +1744,11 @@ static int boe_panel_probe(struct mipi_dsi_device *dsi)
17461744
int ret;
17471745
const struct panel_desc *desc;
17481746

1749-
boe = devm_kzalloc(&dsi->dev, sizeof(*boe), GFP_KERNEL);
1750-
if (!boe)
1751-
return -ENOMEM;
1747+
boe = devm_drm_panel_alloc(&dsi->dev, __typeof(*boe), base,
1748+
&boe_panel_funcs, DRM_MODE_CONNECTOR_DSI);
1749+
1750+
if (IS_ERR(boe))
1751+
return PTR_ERR(boe);
17521752

17531753
desc = of_device_get_match_data(&dsi->dev);
17541754
dsi->lanes = desc->lanes;

0 commit comments

Comments
 (0)