diff options
author | Jani Nikula <jani.nikula@intel.com> | 2024-08-12 12:30:21 +0200 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2024-08-13 11:11:49 +0200 |
commit | d408d6f8cbbb5ad92b383f33d091f027f5740aea (patch) | |
tree | 1276c20b2198ee1f57d230206afde7124028c6e3 /drivers/gpu/drm/xe/xe_device.h | |
parent | drm/xe: use pdev_to_xe_device() instead of pci_get_drvdata() directly (diff) | |
download | linux-d408d6f8cbbb5ad92b383f33d091f027f5740aea.tar.xz linux-d408d6f8cbbb5ad92b383f33d091f027f5740aea.zip |
drm/xe: add kdev_to_xe_device() helper and use it
There are enough users for kernel device to xe device conversion, add a
helper for it.
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/38c80846e70c7e410850530426384e17cff9d031.1723458544.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_device.h')
-rw-r--r-- | drivers/gpu/drm/xe/xe_device.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h index db6cc8d0d6b8..2c96f1b2aafd 100644 --- a/drivers/gpu/drm/xe/xe_device.h +++ b/drivers/gpu/drm/xe/xe_device.h @@ -15,6 +15,11 @@ static inline struct xe_device *to_xe_device(const struct drm_device *dev) return container_of(dev, struct xe_device, drm); } +static inline struct xe_device *kdev_to_xe_device(struct device *kdev) +{ + return dev_get_drvdata(kdev); +} + static inline struct xe_device *pdev_to_xe_device(struct pci_dev *pdev) { return pci_get_drvdata(pdev); |