Commit 4c99859f authored by Daniel Vetter's avatar Daniel Vetter

drm/ili9225: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.
Acked-by: default avatarDavid Lechner <david@lechnology.com>
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Cc: David Lechner <david@lechnology.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-20-daniel.vetter@ffwll.ch
parent 5301e305
...@@ -376,18 +376,13 @@ static int ili9225_probe(struct spi_device *spi) ...@@ -376,18 +376,13 @@ static int ili9225_probe(struct spi_device *spi)
u32 rotation = 0; u32 rotation = 0;
int ret; int ret;
dbidev = kzalloc(sizeof(*dbidev), GFP_KERNEL); dbidev = devm_drm_dev_alloc(dev, &ili9225_driver,
if (!dbidev) struct mipi_dbi_dev, drm);
return -ENOMEM; if (IS_ERR(dbidev))
return PTR_ERR(dbidev);
dbi = &dbidev->dbi; dbi = &dbidev->dbi;
drm = &dbidev->drm; drm = &dbidev->drm;
ret = devm_drm_dev_init(dev, drm, &ili9225_driver);
if (ret) {
kfree(dbidev);
return ret;
}
drmm_add_final_kfree(drm, dbidev);
dbi->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); dbi->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(dbi->reset)) { if (IS_ERR(dbi->reset)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment