summaryrefslogtreecommitdiff
path: root/drivers/iommu/irq_remapping.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iommu/irq_remapping.c')
-rw-r--r--drivers/iommu/irq_remapping.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
index e7449b42504d..7d85d2ba0e8b 100644
--- a/drivers/iommu/irq_remapping.c
+++ b/drivers/iommu/irq_remapping.c
@@ -204,15 +204,15 @@ int __init irq_remapping_prepare(void)
if (disable_irq_remap)
return -ENOSYS;
- remap_ops = &intel_irq_remap_ops;
-
-#ifdef CONFIG_AMD_IOMMU
- if (amd_iommu_irq_ops.prepare() == 0) {
+ if (intel_irq_remap_ops.prepare() == 0)
+ remap_ops = &intel_irq_remap_ops;
+ else if (IS_ENABLED(CONFIG_AMD_IOMMU) &&
+ amd_iommu_irq_ops.prepare() == 0)
remap_ops = &amd_iommu_irq_ops;
- return 0;
- }
-#endif
- return remap_ops->prepare();
+ else
+ return -ENOSYS;
+
+ return 0;
}
int __init irq_remapping_enable(void)