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

index 4dbf8b88f264f7afcacf2ae8f67704f5a7505341..af7e2047fc1f16ef6aa7bf22800664137291c526 100644 (file)
@@ -322,9 +322,11 @@ static int td028ttec1_probe(struct spi_device *spi)
        struct td028ttec1_panel *lcd;
        int ret;
 
-       lcd = devm_kzalloc(&spi->dev, sizeof(*lcd), GFP_KERNEL);
-       if (!lcd)
-               return -ENOMEM;
+       lcd = devm_drm_panel_alloc(&spi->dev, struct td028ttec1_panel, panel,
+                                  &td028ttec1_funcs,
+                                  DRM_MODE_CONNECTOR_DPI);
+       if (IS_ERR(lcd))
+               return PTR_ERR(lcd);
 
        spi_set_drvdata(spi, lcd);
        lcd->spi = spi;
@@ -338,9 +340,6 @@ static int td028ttec1_probe(struct spi_device *spi)
                return ret;
        }
 
-       drm_panel_init(&lcd->panel, &lcd->spi->dev, &td028ttec1_funcs,
-                      DRM_MODE_CONNECTOR_DPI);
-
        ret = drm_panel_of_backlight(&lcd->panel);
        if (ret)
                return ret;