[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20191220115935.15152-3-kraxel@redhat.com>
Date: Fri, 20 Dec 2019 12:59:33 +0100
From: Gerd Hoffmann <kraxel@...hat.com>
To: dri-devel@...ts.freedesktop.org
Cc: Gerd Hoffmann <kraxel@...hat.com>,
Dave Airlie <airlied@...hat.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
virtualization@...ts.linux-foundation.org (open list:DRM DRIVER FOR
QEMU'S CIRRUS DEVICE), linux-kernel@...r.kernel.org (open list)
Subject: [PATCH 2/4] drm/cirrus: add drm_driver.release callback.
Move final cleanups from cirrus_pci_remove() to the new callback.
Add drm_atomic_helper_shutdown() call to cirrus_pci_remove().
Signed-off-by: Gerd Hoffmann <kraxel@...hat.com>
---
drivers/gpu/drm/cirrus/cirrus.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/cirrus/cirrus.c b/drivers/gpu/drm/cirrus/cirrus.c
index 248c9f765c45..a4ca66f9a423 100644
--- a/drivers/gpu/drm/cirrus/cirrus.c
+++ b/drivers/gpu/drm/cirrus/cirrus.c
@@ -510,6 +510,16 @@ static void cirrus_mode_config_init(struct cirrus_device *cirrus)
/* ------------------------------------------------------------------ */
+static void cirrus_release(struct drm_device *dev)
+{
+ struct cirrus_device *cirrus = dev->dev_private;
+
+ drm_mode_config_cleanup(dev);
+ iounmap(cirrus->mmio);
+ iounmap(cirrus->vram);
+ kfree(cirrus);
+}
+
DEFINE_DRM_GEM_FOPS(cirrus_fops);
static struct drm_driver cirrus_driver = {
@@ -523,6 +533,7 @@ static struct drm_driver cirrus_driver = {
.fops = &cirrus_fops,
DRM_GEM_SHMEM_DRIVER_OPS,
+ .release = cirrus_release,
};
static int cirrus_pci_probe(struct pci_dev *pdev,
@@ -604,14 +615,10 @@ static int cirrus_pci_probe(struct pci_dev *pdev,
static void cirrus_pci_remove(struct pci_dev *pdev)
{
struct drm_device *dev = pci_get_drvdata(pdev);
- struct cirrus_device *cirrus = dev->dev_private;
drm_dev_unregister(dev);
- drm_mode_config_cleanup(dev);
- iounmap(cirrus->mmio);
- iounmap(cirrus->vram);
+ drm_atomic_helper_shutdown(dev);
drm_dev_put(dev);
- kfree(cirrus);
pci_release_regions(pdev);
}
--
2.18.1
Powered by blists - more mailing lists