summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tiny
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2020-04-15 09:39:49 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2020-04-28 15:44:10 +0200
commite20b873802b6a8c8c65cd85ecf79a3615f3a0a5c (patch)
treeba1b62b51f365a89fb3f0014aaa8e50bb3cef84d /drivers/gpu/drm/tiny
parent14877bc715973d145d977e6054d5d2b6468ff460 (diff)
drm/st7586: 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-15-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/tiny')
-rw-r--r--drivers/gpu/drm/tiny/st7586.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/gpu/drm/tiny/st7586.c b/drivers/gpu/drm/tiny/st7586.c
index c3295c717ba6..2a1fae422f7a 100644
--- a/drivers/gpu/drm/tiny/st7586.c
+++ b/drivers/gpu/drm/tiny/st7586.c
@@ -317,18 +317,13 @@ static int st7586_probe(struct spi_device *spi)
size_t bufsize;
int ret;
- dbidev = kzalloc(sizeof(*dbidev), GFP_KERNEL);
- if (!dbidev)
- return -ENOMEM;
+ dbidev = devm_drm_dev_alloc(dev, &st7586_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, &st7586_driver);
- if (ret) {
- kfree(dbidev);
- return ret;
- }
- drmm_add_final_kfree(drm, dbidev);
bufsize = (st7586_mode.vdisplay + 2) / 3 * st7586_mode.hdisplay;