Skip to content

Commit 6299cb4

Browse files
anushasrivatsmripard
authored andcommitted
drm/panel/raspberrypi: 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-2-de73ba81b2f5@redhat.com Signed-off-by: Maxime Ripard <[email protected]>
1 parent 1e57377 commit 6299cb4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,12 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c)
373373
.node = NULL,
374374
};
375375

376-
ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL);
377-
if (!ts)
378-
return -ENOMEM;
376+
ts = devm_drm_panel_alloc(dev, __typeof(*ts), base,
377+
&rpi_touchscreen_funcs,
378+
DRM_MODE_CONNECTOR_DSI);
379+
380+
if (IS_ERR(ts))
381+
return PTR_ERR(ts);
379382

380383
i2c_set_clientdata(i2c, ts);
381384

@@ -428,9 +431,6 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c)
428431
return PTR_ERR(ts->dsi);
429432
}
430433

431-
drm_panel_init(&ts->base, dev, &rpi_touchscreen_funcs,
432-
DRM_MODE_CONNECTOR_DSI);
433-
434434
/* This appears last, as it's what will unblock the DSI host
435435
* driver's component bind function.
436436
*/

0 commit comments

Comments
 (0)