]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
panel/sharp-ls060t1sx01: Use refcounted allocation in place of devm_kzalloc()
authorAnusha Srivatsa <asrivats@redhat.com>
Fri, 30 May 2025 02:46:27 +0000 (21:46 -0500)
committerMaxime Ripard <mripard@kernel.org>
Mon, 2 Jun 2025 07:21:58 +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-25-5d75a3711e40@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/panel/panel-sharp-ls060t1sx01.c

index 0b4e0983639bd6e0b1b81df04331e9957414d4f3..0456f3d705e72e53255c20b42d50423721c9d906 100644 (file)
@@ -193,9 +193,11 @@ static int sharp_ls060_probe(struct mipi_dsi_device *dsi)
        struct sharp_ls060 *ctx;
        int ret;
 
-       ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
-       if (!ctx)
-               return -ENOMEM;
+       ctx = devm_drm_panel_alloc(dev, struct sharp_ls060, panel,
+                                  &sharp_ls060_panel_funcs,
+                                  DRM_MODE_CONNECTOR_DSI);
+       if (IS_ERR(ctx))
+               return PTR_ERR(ctx);
 
        ctx->vddi_supply = devm_regulator_get(dev, "vddi");
        if (IS_ERR(ctx->vddi_supply))
@@ -227,9 +229,6 @@ static int sharp_ls060_probe(struct mipi_dsi_device *dsi)
                          MIPI_DSI_MODE_NO_EOT_PACKET |
                          MIPI_DSI_CLOCK_NON_CONTINUOUS;
 
-       drm_panel_init(&ctx->panel, dev, &sharp_ls060_panel_funcs,
-                      DRM_MODE_CONNECTOR_DSI);
-
        ret = drm_panel_of_backlight(&ctx->panel);
        if (ret)
                return dev_err_probe(dev, ret, "Failed to get backlight\n");