Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

panel/lcd-olinuxino: 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-29-f7ae7b723c68@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>

authored by

Anusha Srivatsa and committed by
Maxime Ripard
d2b67baa 6e8fba44

+5 -6
+5 -6
drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c
··· 175 175 I2C_FUNC_SMBUS_READ_I2C_BLOCK)) 176 176 return -ENODEV; 177 177 178 - lcd = devm_kzalloc(dev, sizeof(*lcd), GFP_KERNEL); 179 - if (!lcd) 180 - return -ENOMEM; 178 + lcd = devm_drm_panel_alloc(dev, struct lcd_olinuxino, panel, 179 + &lcd_olinuxino_funcs, 180 + DRM_MODE_CONNECTOR_DPI); 181 + if (IS_ERR(lcd)) 182 + return PTR_ERR(lcd); 181 183 182 184 i2c_set_clientdata(client, lcd); 183 185 lcd->dev = dev; ··· 235 233 lcd->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); 236 234 if (IS_ERR(lcd->enable_gpio)) 237 235 return PTR_ERR(lcd->enable_gpio); 238 - 239 - drm_panel_init(&lcd->panel, dev, &lcd_olinuxino_funcs, 240 - DRM_MODE_CONNECTOR_DPI); 241 236 242 237 ret = drm_panel_of_backlight(&lcd->panel); 243 238 if (ret)