summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tiny
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2020-04-15 09:39:54 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2020-04-28 15:48:20 +0200
commit4c99859f3bf9e40e7859878b697adb8581cb6ac0 (patch)
treea4240997ab379a006373c5e7907deec526268825 /drivers/gpu/drm/tiny
parent5301e305c682a879666371cdcddf37bbce2ef77e (diff)
drm/ili9225: Use devm_drm_dev_alloc
Already using devm_drm_dev_init, so very simple replacment. Acked-by: David Lechner <david@lechnology.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Daniel 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
Diffstat (limited to 'drivers/gpu/drm/tiny')
-rw-r--r--drivers/gpu/drm/tiny/ili9225.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/gpu/drm/tiny/ili9225.c b/drivers/gpu/drm/tiny/ili9225.c
index 118477af4491..d1a5ab6747d5 100644
--- a/drivers/gpu/drm/tiny/ili9225.c
+++ b/drivers/gpu/drm/tiny/ili9225.c
@@ -376,18 +376,13 @@ static int ili9225_probe(struct spi_device *spi)
u32 rotation = 0;
int ret;
- dbidev = kzalloc(sizeof(*dbidev), GFP_KERNEL);
- if (!dbidev)
- return -ENOMEM;
+ dbidev = devm_drm_dev_alloc(dev, &ili9225_driver,
+ struct mipi_dbi_dev, drm);
+ if (IS_ERR(dbidev))
+ return PTR_ERR(dbidev);
dbi = &dbidev->dbi;
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);
if (IS_ERR(dbi->reset)) {