]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
panel/panel-elida-kd35t133: Use refcounted allocation in place of devm_kzalloc()
authorAnusha Srivatsa <asrivats@redhat.com>
Wed, 21 May 2025 03:03:32 +0000 (22:03 -0500)
committerMaxime Ripard <mripard@kernel.org>
Wed, 21 May 2025 06:40:55 +0000 (08:40 +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/20250520-drivers-mass-convert-part2-v3-1-f7ae7b723c68@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/panel/panel-elida-kd35t133.c

index b904d54374449055b16df0c9abf132d2c944a6ff..1f177834d62986679830b15b960fb7299ca65cfa 100644 (file)
@@ -206,9 +206,10 @@ static int kd35t133_probe(struct mipi_dsi_device *dsi)
        struct kd35t133 *ctx;
        int ret;
 
-       ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
-       if (!ctx)
-               return -ENOMEM;
+       ctx = devm_drm_panel_alloc(dev, struct kd35t133, panel,
+                                  &kd35t133_funcs, DRM_MODE_CONNECTOR_DSI);
+       if (IS_ERR(ctx))
+               return PTR_ERR(ctx);
 
        ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
        if (IS_ERR(ctx->reset_gpio)) {
@@ -248,9 +249,6 @@ static int kd35t133_probe(struct mipi_dsi_device *dsi)
                          MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET |
                          MIPI_DSI_CLOCK_NON_CONTINUOUS;
 
-       drm_panel_init(&ctx->panel, &dsi->dev, &kd35t133_funcs,
-                      DRM_MODE_CONNECTOR_DSI);
-
        ret = drm_panel_of_backlight(&ctx->panel);
        if (ret)
                return ret;