Commit f3eb15bb authored by Daniel Vetter's avatar Daniel Vetter

drm/hx8357d: Use devm_drm_dev_alloc

Already using devm_drm_dev_init, so very simple replacment.
Acked-by: default avatarEric Anholt <eric@anholt.net>
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Cc: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-21-daniel.vetter@ffwll.ch
parent 4c99859f
......@@ -226,17 +226,12 @@ static int hx8357d_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, &hx8357d_driver,
struct mipi_dbi_dev, drm);
if (IS_ERR(dbidev))
return PTR_ERR(dbidev);
drm = &dbidev->drm;
ret = devm_drm_dev_init(dev, drm, &hx8357d_driver);
if (ret) {
kfree(dbidev);
return ret;
}
drmm_add_final_kfree(drm, dbidev);
dc = devm_gpiod_get(dev, "dc", GPIOD_OUT_LOW);
if (IS_ERR(dc)) {
......
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