panel/samsung-ld9040: Use refcounted allocation in place of devm_kzalloc()

Move to using the new API devm_drm_panel_alloc() to allocate the
panel.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
Link: https://lore.kernel.org/r/20250529-b4-drm_panel_mass_driver_convert_part3-v2-12-5d75a3711e40@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
Anusha Srivatsa 2025-05-29 21:46:14 -05:00 committed by Maxime Ripard
parent f43a0ed027
commit bbd6988422
No known key found for this signature in database
GPG Key ID: 275FCE19A23DBE76

View File

@ -339,9 +339,11 @@ static int ld9040_probe(struct spi_device *spi)
struct ld9040 *ctx;
int ret;
ctx = devm_kzalloc(dev, sizeof(struct ld9040), GFP_KERNEL);
if (!ctx)
return -ENOMEM;
ctx = devm_drm_panel_alloc(dev, struct ld9040, panel,
&ld9040_drm_funcs,
DRM_MODE_CONNECTOR_DPI);
if (IS_ERR(ctx))
return PTR_ERR(ctx);
spi_set_drvdata(spi, ctx);
@ -373,9 +375,6 @@ static int ld9040_probe(struct spi_device *spi)
return ret;
}
drm_panel_init(&ctx->panel, dev, &ld9040_drm_funcs,
DRM_MODE_CONNECTOR_DPI);
bldev = devm_backlight_device_register(dev, dev_name(dev), dev,
ctx, &ld9040_bl_ops,
&ld9040_bl_props);