summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/iommu.c
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2019-05-21 03:27:35 -0400
committerJoerg Roedel <jroedel@suse.de>2019-05-27 10:30:59 -0400
commit57274ea25736496ee019a5c40479855b21888839 (patch)
treeb323e8f83c00f64f3ec374e5401a2ec7c8fcbe85 /drivers/iommu/iommu.c
parentcd6c84d8f0cdc911df435bb075ba22ce3c605b07 (diff)
iommu: Use right function to get group for device
The iommu_group_get_for_dev() will allocate a group for a device if it isn't in any group. This isn't the use case in iommu_request_dm_for_dev(). Let's use iommu_group_get() instead. Fixes: d290f1e70d85a ("iommu: Introduce iommu_request_dm_for_dev()") Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/iommu.c')
-rw-r--r--drivers/iommu/iommu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 67ee6623f9b2..3fa025f849e9 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -1915,9 +1915,9 @@ int iommu_request_dm_for_dev(struct device *dev)
1915 int ret; 1915 int ret;
1916 1916
1917 /* Device must already be in a group before calling this function */ 1917 /* Device must already be in a group before calling this function */
1918 group = iommu_group_get_for_dev(dev); 1918 group = iommu_group_get(dev);
1919 if (IS_ERR(group)) 1919 if (!group)
1920 return PTR_ERR(group); 1920 return -EINVAL;
1921 1921
1922 mutex_lock(&group->mutex); 1922 mutex_lock(&group->mutex);
1923 1923