panel/lg-lg4573: 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/20250520-drivers-mass-convert-part2-v3-17-f7ae7b723c68@redhat.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
committed by
Maxime Ripard
parent
deafcd1f93
commit
89da5d30fa
@@ -243,9 +243,11 @@ static int lg4573_probe(struct spi_device *spi)
|
||||
struct lg4573 *ctx;
|
||||
int ret;
|
||||
|
||||
ctx = devm_kzalloc(&spi->dev, sizeof(*ctx), GFP_KERNEL);
|
||||
if (!ctx)
|
||||
return -ENOMEM;
|
||||
ctx = devm_drm_panel_alloc(&spi->dev, struct lg4573, panel,
|
||||
&lg4573_drm_funcs,
|
||||
DRM_MODE_CONNECTOR_DPI);
|
||||
if (IS_ERR(ctx))
|
||||
return PTR_ERR(ctx);
|
||||
|
||||
ctx->spi = spi;
|
||||
|
||||
@@ -258,9 +260,6 @@ static int lg4573_probe(struct spi_device *spi)
|
||||
return ret;
|
||||
}
|
||||
|
||||
drm_panel_init(&ctx->panel, &spi->dev, &lg4573_drm_funcs,
|
||||
DRM_MODE_CONNECTOR_DPI);
|
||||
|
||||
drm_panel_add(&ctx->panel);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user