Skip to content

Commit

Permalink
drm/st7586: Use devm_drm_dev_alloc
Browse files Browse the repository at this point in the history
Already using devm_drm_dev_init, so very simple replacment.

Acked-by: David Lechner <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Cc: David Lechner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
danvet committed Apr 28, 2020
1 parent 14877bc commit e20b873
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions drivers/gpu/drm/tiny/st7586.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit e20b873

Please sign in to comment.