[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20190723111031.11012-1-hslester96@gmail.com>
Date: Tue, 23 Jul 2019 19:10:31 +0800
From: Chuhong Yuan <hslester96@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: VMware Graphics <linux-graphics-maintainer@...are.com>,
Thomas Hellstrom <thellstrom@...are.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
Chuhong Yuan <hslester96@...il.com>
Subject: [PATCH] drm/vmwgfx: Use dev_get_drvdata
Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.
Signed-off-by: Chuhong Yuan <hslester96@...il.com>
---
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 9506190a0300..8f5f5980c9d8 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -1448,8 +1448,7 @@ static int vmw_pm_resume(struct device *kdev)
static int vmw_pm_freeze(struct device *kdev)
{
- struct pci_dev *pdev = to_pci_dev(kdev);
- struct drm_device *dev = pci_get_drvdata(pdev);
+ struct drm_device *dev = dev_get_drvdata(kdev);
struct vmw_private *dev_priv = vmw_priv(dev);
int ret;
@@ -1497,8 +1496,7 @@ static int vmw_pm_freeze(struct device *kdev)
static int vmw_pm_restore(struct device *kdev)
{
- struct pci_dev *pdev = to_pci_dev(kdev);
- struct drm_device *dev = pci_get_drvdata(pdev);
+ struct drm_device *dev = dev_get_drvdata(kdev);
struct vmw_private *dev_priv = vmw_priv(dev);
int ret;
--
2.20.1
Powered by blists - more mailing lists