]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
panel/samsung-s6d27a1: Use refcounted allocation in place of devm_kzalloc()
authorAnusha Srivatsa <asrivats@redhat.com>
Fri, 30 May 2025 02:46:16 +0000 (21:46 -0500)
committerMaxime Ripard <mripard@kernel.org>
Mon, 2 Jun 2025 07:21:52 +0000 (09:21 +0200)
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>
drivers/gpu/drm/panel/panel-samsung-s6d27a1.c

index 2adb223a895c9c89703abcf1148fbe9bd6c0da41..300dc19bd9d135ec889f9604fb14637bb60fc250 100644 (file)
@@ -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");