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>
This commit is contained in:
committed by
Maxime Ripard
parent
6e8fba44da
commit
d2b67baa89
@@ -175,9 +175,11 @@ static int lcd_olinuxino_probe(struct i2c_client *client)
|
||||
I2C_FUNC_SMBUS_READ_I2C_BLOCK))
|
||||
return -ENODEV;
|
||||
|
||||
lcd = devm_kzalloc(dev, sizeof(*lcd), GFP_KERNEL);
|
||||
if (!lcd)
|
||||
return -ENOMEM;
|
||||
lcd = devm_drm_panel_alloc(dev, struct lcd_olinuxino, panel,
|
||||
&lcd_olinuxino_funcs,
|
||||
DRM_MODE_CONNECTOR_DPI);
|
||||
if (IS_ERR(lcd))
|
||||
return PTR_ERR(lcd);
|
||||
|
||||
i2c_set_clientdata(client, lcd);
|
||||
lcd->dev = dev;
|
||||
@@ -234,9 +236,6 @@ static int lcd_olinuxino_probe(struct i2c_client *client)
|
||||
if (IS_ERR(lcd->enable_gpio))
|
||||
return PTR_ERR(lcd->enable_gpio);
|
||||
|
||||
drm_panel_init(&lcd->panel, dev, &lcd_olinuxino_funcs,
|
||||
DRM_MODE_CONNECTOR_DPI);
|
||||
|
||||
ret = drm_panel_of_backlight(&lcd->panel);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user