iommu/vt-d: Change iommu_enable/disable_translation to return void
Simplify error handling path by changing iommu_{enable|disable}_translation to return void. Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
Родитель
8594d83261
Коммит
2a41ccee2f
|
@ -1389,7 +1389,7 @@ static void iommu_disable_protect_mem_regions(struct intel_iommu *iommu)
|
||||||
raw_spin_unlock_irqrestore(&iommu->register_lock, flags);
|
raw_spin_unlock_irqrestore(&iommu->register_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int iommu_enable_translation(struct intel_iommu *iommu)
|
static void iommu_enable_translation(struct intel_iommu *iommu)
|
||||||
{
|
{
|
||||||
u32 sts;
|
u32 sts;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
@ -1403,10 +1403,9 @@ static int iommu_enable_translation(struct intel_iommu *iommu)
|
||||||
readl, (sts & DMA_GSTS_TES), sts);
|
readl, (sts & DMA_GSTS_TES), sts);
|
||||||
|
|
||||||
raw_spin_unlock_irqrestore(&iommu->register_lock, flags);
|
raw_spin_unlock_irqrestore(&iommu->register_lock, flags);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int iommu_disable_translation(struct intel_iommu *iommu)
|
static void iommu_disable_translation(struct intel_iommu *iommu)
|
||||||
{
|
{
|
||||||
u32 sts;
|
u32 sts;
|
||||||
unsigned long flag;
|
unsigned long flag;
|
||||||
|
@ -1420,7 +1419,6 @@ static int iommu_disable_translation(struct intel_iommu *iommu)
|
||||||
readl, (!(sts & DMA_GSTS_TES)), sts);
|
readl, (!(sts & DMA_GSTS_TES)), sts);
|
||||||
|
|
||||||
raw_spin_unlock_irqrestore(&iommu->register_lock, flag);
|
raw_spin_unlock_irqrestore(&iommu->register_lock, flag);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2860,11 +2858,7 @@ static int __init init_dmars(void)
|
||||||
|
|
||||||
iommu->flush.flush_context(iommu, 0, 0, 0, DMA_CCMD_GLOBAL_INVL);
|
iommu->flush.flush_context(iommu, 0, 0, 0, DMA_CCMD_GLOBAL_INVL);
|
||||||
iommu->flush.flush_iotlb(iommu, 0, 0, 0, DMA_TLB_GLOBAL_FLUSH);
|
iommu->flush.flush_iotlb(iommu, 0, 0, 0, DMA_TLB_GLOBAL_FLUSH);
|
||||||
|
iommu_enable_translation(iommu);
|
||||||
ret = iommu_enable_translation(iommu);
|
|
||||||
if (ret)
|
|
||||||
goto free_iommu;
|
|
||||||
|
|
||||||
iommu_disable_protect_mem_regions(iommu);
|
iommu_disable_protect_mem_regions(iommu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3578,10 +3572,8 @@ static int init_iommu_hw(void)
|
||||||
|
|
||||||
iommu->flush.flush_context(iommu, 0, 0, 0,
|
iommu->flush.flush_context(iommu, 0, 0, 0,
|
||||||
DMA_CCMD_GLOBAL_INVL);
|
DMA_CCMD_GLOBAL_INVL);
|
||||||
iommu->flush.flush_iotlb(iommu, 0, 0, 0,
|
iommu->flush.flush_iotlb(iommu, 0, 0, 0, DMA_TLB_GLOBAL_FLUSH);
|
||||||
DMA_TLB_GLOBAL_FLUSH);
|
iommu_enable_translation(iommu);
|
||||||
if (iommu_enable_translation(iommu))
|
|
||||||
return 1;
|
|
||||||
iommu_disable_protect_mem_regions(iommu);
|
iommu_disable_protect_mem_regions(iommu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче