mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 11:37:06 +02:00
panel/ilitek-ili9341: 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/20250520-drivers-mass-convert-part2-v3-7-f7ae7b723c68@redhat.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
parent
9609efa05d
commit
75db23f878
|
|
@ -490,9 +490,11 @@ static int ili9341_dpi_probe(struct spi_device *spi, struct gpio_desc *dc,
|
|||
struct ili9341 *ili;
|
||||
int ret;
|
||||
|
||||
ili = devm_kzalloc(dev, sizeof(struct ili9341), GFP_KERNEL);
|
||||
if (!ili)
|
||||
return -ENOMEM;
|
||||
ili = devm_drm_panel_alloc(dev, struct ili9341, panel,
|
||||
&ili9341_dpi_funcs,
|
||||
DRM_MODE_CONNECTOR_DPI);
|
||||
if (IS_ERR(ili))
|
||||
return PTR_ERR(ili);
|
||||
|
||||
ili->dbi = devm_kzalloc(dev, sizeof(struct mipi_dbi),
|
||||
GFP_KERNEL);
|
||||
|
|
@ -526,8 +528,6 @@ static int ili9341_dpi_probe(struct spi_device *spi, struct gpio_desc *dc,
|
|||
}
|
||||
|
||||
ili->max_spi_speed = ili->conf->max_spi_speed;
|
||||
drm_panel_init(&ili->panel, dev, &ili9341_dpi_funcs,
|
||||
DRM_MODE_CONNECTOR_DPI);
|
||||
drm_panel_add(&ili->panel);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user