mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 18:43:33 +02:00
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:
parent
f43a0ed027
commit
bbd6988422
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user