mirror of
https://github.com/torvalds/linux.git
synced 2026-03-13 22:36:17 +01:00
panel/samsung-s6d27a1: 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-14-5d75a3711e40@redhat.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
parent
f76893223c
commit
532d4c33db
1 changed files with 5 additions and 6 deletions
|
|
@ -247,9 +247,11 @@ static int s6d27a1_probe(struct spi_device *spi)
|
|||
struct s6d27a1 *ctx;
|
||||
int ret;
|
||||
|
||||
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
|
||||
if (!ctx)
|
||||
return -ENOMEM;
|
||||
ctx = devm_drm_panel_alloc(dev, struct s6d27a1, panel,
|
||||
&s6d27a1_drm_funcs,
|
||||
DRM_MODE_CONNECTOR_DPI);
|
||||
if (IS_ERR(ctx))
|
||||
return PTR_ERR(ctx);
|
||||
|
||||
ctx->dev = dev;
|
||||
|
||||
|
|
@ -277,9 +279,6 @@ static int s6d27a1_probe(struct spi_device *spi)
|
|||
|
||||
ctx->dbi.read_commands = s6d27a1_dbi_read_commands;
|
||||
|
||||
drm_panel_init(&ctx->panel, dev, &s6d27a1_drm_funcs,
|
||||
DRM_MODE_CONNECTOR_DPI);
|
||||
|
||||
ret = drm_panel_of_backlight(&ctx->panel);
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "failed to add backlight\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue