diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2020-04-15 09:40:02 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2020-04-28 20:04:01 +0200 |
commit | e304f8a0513b830be37b3f5059c3d8fcaacda4b7 (patch) | |
tree | 120508eb14f8b82cd433690811c812d5ec176cc9 /drivers/gpu/drm/qxl/qxl_drv.c | |
parent | a9b0b24a6fff2d269eb966d7e4eca498bf9f0bba (diff) |
drm/qxl: Don't use drm_device->dev_private
Upcasting using a container_of macro is more typesafe, faster and
easier for the compiler to optimize.
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: virtualization@lists.linux-foundation.org
Cc: spice-devel@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-28-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/qxl/qxl_drv.c')
-rw-r--r-- | drivers/gpu/drm/qxl/qxl_drv.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index 6b4ae4c5fb76..13872b882775 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.c +++ b/drivers/gpu/drm/qxl/qxl_drv.c @@ -137,7 +137,7 @@ disable_pci: static void qxl_drm_release(struct drm_device *dev) { - struct qxl_device *qdev = dev->dev_private; + struct qxl_device *qdev = to_qxl(dev); /* * TODO: qxl_device_fini() call should be in qxl_pci_remove(), @@ -164,7 +164,7 @@ DEFINE_DRM_GEM_FOPS(qxl_fops); static int qxl_drm_freeze(struct drm_device *dev) { struct pci_dev *pdev = dev->pdev; - struct qxl_device *qdev = dev->dev_private; + struct qxl_device *qdev = to_qxl(dev); int ret; ret = drm_mode_config_helper_suspend(dev); @@ -186,7 +186,7 @@ static int qxl_drm_freeze(struct drm_device *dev) static int qxl_drm_resume(struct drm_device *dev, bool thaw) { - struct qxl_device *qdev = dev->dev_private; + struct qxl_device *qdev = to_qxl(dev); qdev->ram_header->int_mask = QXL_INTERRUPT_MASK; if (!thaw) { @@ -245,7 +245,7 @@ static int qxl_pm_restore(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct drm_device *drm_dev = pci_get_drvdata(pdev); - struct qxl_device *qdev = drm_dev->dev_private; + struct qxl_device *qdev = to_qxl(drm_dev); qxl_io_reset(qdev); return qxl_drm_resume(drm_dev, false); |