summaryrefslogtreecommitdiff
path: root/drivers/iommu/amd_iommu.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2013-04-09 13:29:20 (GMT)
committerArnd Bergmann <arnd@arndb.de>2013-04-09 13:29:43 (GMT)
commit44c0d2377539fafd1023ec7e16765b71c7f4fbce (patch)
tree49065c2af83c723f150bf636939790ad3108a897 /drivers/iommu/amd_iommu.c
parent8024206dbf4e0701f0cdf259a122ea23db3a7a16 (diff)
parent07961ac7c0ee8b546658717034fe692fd12eefa9 (diff)
downloadlinux-fsl-qoriq-44c0d2377539fafd1023ec7e16765b71c7f4fbce.tar.xz
Merge tag 'v3.9-rc5' into next/cleanup
This is a dependency for the mxs/cleanup branch. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/iommu/amd_iommu.c')
-rw-r--r--drivers/iommu/amd_iommu.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 98f555d..b287ca3 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2466,18 +2466,16 @@ static int device_change_notifier(struct notifier_block *nb,
/* allocate a protection domain if a device is added */
dma_domain = find_protection_domain(devid);
- if (dma_domain)
- goto out;
- dma_domain = dma_ops_domain_alloc();
- if (!dma_domain)
- goto out;
- dma_domain->target_dev = devid;
-
- spin_lock_irqsave(&iommu_pd_list_lock, flags);
- list_add_tail(&dma_domain->list, &iommu_pd_list);
- spin_unlock_irqrestore(&iommu_pd_list_lock, flags);
-
- dev_data = get_dev_data(dev);
+ if (!dma_domain) {
+ dma_domain = dma_ops_domain_alloc();
+ if (!dma_domain)
+ goto out;
+ dma_domain->target_dev = devid;
+
+ spin_lock_irqsave(&iommu_pd_list_lock, flags);
+ list_add_tail(&dma_domain->list, &iommu_pd_list);
+ spin_unlock_irqrestore(&iommu_pd_list_lock, flags);
+ }
dev->archdata.dma_ops = &amd_iommu_dma_ops;