diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2020-07-30 15:52:06 +0200 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2020-08-03 09:05:00 +0200 |
commit | cff0adca1edd6eb2bc6116e4d83e442f372cca64 (patch) | |
tree | 315ee5445a9b730048c97846ee01bb005e8a4903 /drivers/gpu/drm/ast/ast_drv.c | |
parent | 4bc85b82c8ba5cfad6d750748d36e2b852fad80d (diff) | |
download | lwn-cff0adca1edd6eb2bc6116e4d83e442f372cca64.tar.gz lwn-cff0adca1edd6eb2bc6116e4d83e442f372cca64.zip |
drm/ast: Managed device release
This turns the ast's device cleanup code into a managed release helper
function. Note that the code uses devres helpers. The release function
switches the device back to VGA mode and therefore runs during HW device
cleanup; not at DRM device cleanup.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730135206.30239-10-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/ast/ast_drv.c')
-rw-r--r-- | drivers/gpu/drm/ast/ast_drv.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c index c394383a7979..f0b4af1c390a 100644 --- a/drivers/gpu/drm/ast/ast_drv.c +++ b/drivers/gpu/drm/ast/ast_drv.c @@ -120,35 +120,24 @@ static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) return ret; ast = ast_device_create(&ast_driver, pdev, ent->driver_data); - if (IS_ERR(ast)) { - ret = PTR_ERR(ast); - goto err_drm_dev_put; - } + if (IS_ERR(ast)) + return PTR_ERR(ast); dev = &ast->base; ret = drm_dev_register(dev, ent->driver_data); if (ret) - goto err_ast_device_destroy; + return ret; drm_fbdev_generic_setup(dev, 32); return 0; - -err_ast_device_destroy: - ast_device_destroy(ast); -err_drm_dev_put: - drm_dev_put(dev); - return ret; } static void ast_pci_remove(struct pci_dev *pdev) { struct drm_device *dev = pci_get_drvdata(pdev); - struct ast_private *ast = to_ast_private(dev); drm_dev_unregister(dev); - ast_device_destroy(ast); - drm_dev_put(dev); } static int ast_drm_freeze(struct drm_device *dev) |