diff options
author | Joerg Roedel <jroedel@suse.de> | 2017-02-28 13:57:18 +0100 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2017-02-28 15:48:23 +0100 |
commit | b7a42b9d38063e58cdf201c575da75943f71051e (patch) | |
tree | fef44bb620a0a59c7de196a26f04b14df33c0ca0 /drivers/iommu/amd_iommu_types.h | |
parent | a7fdb6e648fb10a4174483b5fc4dac9c25bd2093 (diff) | |
download | op-kernel-dev-b7a42b9d38063e58cdf201c575da75943f71051e.zip op-kernel-dev-b7a42b9d38063e58cdf201c575da75943f71051e.tar.gz |
iommu/amd: Fix crash when accessing AMD-Vi sysfs entries
The link between the iommu sysfs-device and the struct
amd_iommu is no longer stored as driver-data. Update the
code to the new correct way of getting from device to
amd_iommu.
Reported-by: Dave Jones <davej@codemonkey.org.uk>
Fixes: 39ab9555c241 ('iommu: Add sysfs bindings for struct iommu_device')
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/amd_iommu_types.h')
-rw-r--r-- | drivers/iommu/amd_iommu_types.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h index af00f38..003f3ce 100644 --- a/drivers/iommu/amd_iommu_types.h +++ b/drivers/iommu/amd_iommu_types.h @@ -569,6 +569,11 @@ struct amd_iommu { volatile u64 __aligned(8) cmd_sem; }; +static inline struct amd_iommu *dev_to_amd_iommu(struct device *dev) +{ + return container_of(dev, struct amd_iommu, iommu.dev); +} + #define ACPIHID_UID_LEN 256 #define ACPIHID_HID_LEN 9 |