Commit 906339a9 authored by Chuhong Yuan's avatar Chuhong Yuan Committed by Chris Wilson

drm/i915: Use dev_get_drvdata

Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.
Signed-off-by: default avatarChuhong Yuan <hslester96@gmail.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190723103915.3964-1-hslester96@gmail.com
parent 44c1ee17
...@@ -2395,8 +2395,7 @@ static int i915_resume_switcheroo(struct drm_device *dev) ...@@ -2395,8 +2395,7 @@ static int i915_resume_switcheroo(struct drm_device *dev)
static int i915_pm_prepare(struct device *kdev) static int i915_pm_prepare(struct device *kdev)
{ {
struct pci_dev *pdev = to_pci_dev(kdev); struct drm_device *dev = dev_get_drvdata(kdev);
struct drm_device *dev = pci_get_drvdata(pdev);
if (!dev) { if (!dev) {
dev_err(kdev, "DRM not initialized, aborting suspend.\n"); dev_err(kdev, "DRM not initialized, aborting suspend.\n");
...@@ -2411,8 +2410,7 @@ static int i915_pm_prepare(struct device *kdev) ...@@ -2411,8 +2410,7 @@ static int i915_pm_prepare(struct device *kdev)
static int i915_pm_suspend(struct device *kdev) static int i915_pm_suspend(struct device *kdev)
{ {
struct pci_dev *pdev = to_pci_dev(kdev); struct drm_device *dev = dev_get_drvdata(kdev);
struct drm_device *dev = pci_get_drvdata(pdev);
if (!dev) { if (!dev) {
dev_err(kdev, "DRM not initialized, aborting suspend.\n"); dev_err(kdev, "DRM not initialized, aborting suspend.\n");
...@@ -2906,8 +2904,7 @@ static int vlv_resume_prepare(struct drm_i915_private *dev_priv, ...@@ -2906,8 +2904,7 @@ static int vlv_resume_prepare(struct drm_i915_private *dev_priv,
static int intel_runtime_suspend(struct device *kdev) static int intel_runtime_suspend(struct device *kdev)
{ {
struct pci_dev *pdev = to_pci_dev(kdev); struct drm_device *dev = dev_get_drvdata(kdev);
struct drm_device *dev = pci_get_drvdata(pdev);
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
struct intel_runtime_pm *rpm = &dev_priv->runtime_pm; struct intel_runtime_pm *rpm = &dev_priv->runtime_pm;
int ret; int ret;
...@@ -3005,8 +3002,7 @@ static int intel_runtime_suspend(struct device *kdev) ...@@ -3005,8 +3002,7 @@ static int intel_runtime_suspend(struct device *kdev)
static int intel_runtime_resume(struct device *kdev) static int intel_runtime_resume(struct device *kdev)
{ {
struct pci_dev *pdev = to_pci_dev(kdev); struct drm_device *dev = dev_get_drvdata(kdev);
struct drm_device *dev = pci_get_drvdata(pdev);
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
struct intel_runtime_pm *rpm = &dev_priv->runtime_pm; struct intel_runtime_pm *rpm = &dev_priv->runtime_pm;
int ret = 0; int ret = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment