diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-08-06 08:42:19 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-08-06 09:36:22 +0100 |
commit | 361f9dc2436812cbcf727fe73d0a4c11ca895fbb (patch) | |
tree | 874102596f1fdd4f5bc4e0d4994194c969c3c8bc /drivers/gpu/drm/i915/i915_drv.h | |
parent | 6c86e5ff2617efaca3db745132de0f004a7494e7 (diff) | |
download | linux-361f9dc2436812cbcf727fe73d0a4c11ca895fbb.tar.bz2 |
drm/i915: Use drm_i915_private directly from drv_get_drvdata()
As we store a pointer to i915 in the drvdata field (as the pointer is both
an alias to the drm_device and drm_i915_private), we can use the stored
pointer directly as the i915 device.
v2: Store and use i915 inside drv_get_drvdata()
v3: Only expect i915 inside drv_get_drvdata() so drop the assumed
i915/drm equivalence.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Andi Shyti <andi.shyti@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190806074219.11043-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.h')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 5f3e5c13fbaa..7f0937948935 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1897,7 +1897,12 @@ static inline struct drm_i915_private *to_i915(const struct drm_device *dev) static inline struct drm_i915_private *kdev_to_i915(struct device *kdev) { - return to_i915(dev_get_drvdata(kdev)); + return dev_get_drvdata(kdev); +} + +static inline struct drm_i915_private *pdev_to_i915(struct pci_dev *pdev) +{ + return pci_get_drvdata(pdev); } static inline struct drm_i915_private *wopcm_to_i915(struct intel_wopcm *wopcm) @@ -2376,7 +2381,7 @@ long i915_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); extern const struct dev_pm_ops i915_pm_ops; int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent); -void i915_driver_remove(struct drm_device *dev); +void i915_driver_remove(struct drm_i915_private *i915); void intel_engine_init_hangcheck(struct intel_engine_cs *engine); int vlv_force_gfx_clock(struct drm_i915_private *dev_priv, bool on); |