[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-30969e34ae6edf10a003f6c0be1fecf6dadcd421@git.kernel.org>
Date: Thu, 15 Jan 2015 05:03:00 -0800
From: tip-bot for Jiang Liu <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: benh@...nel.crashing.org, tony.luck@...el.com, joro@...tes.org,
yinghai@...nel.org, mingo@...nel.org, hpa@...or.com,
tglx@...utronix.de, bp@...en8.de, linux-kernel@...r.kernel.org,
jiang.liu@...ux.intel.com
Subject: [tip:x86/apic] iommu/irq_remapping:
Refine function irq_remapping_prepare() for maintenance
Commit-ID: 30969e34ae6edf10a003f6c0be1fecf6dadcd421
Gitweb: http://git.kernel.org/tip/30969e34ae6edf10a003f6c0be1fecf6dadcd421
Author: Jiang Liu <jiang.liu@...ux.intel.com>
AuthorDate: Wed, 7 Jan 2015 15:31:41 +0800
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Thu, 15 Jan 2015 11:24:24 +0100
iommu/irq_remapping: Refine function irq_remapping_prepare() for maintenance
Assign intel_irq_remap_ops to remap_ops only if
intel_irq_remap_ops.prepare() succeeds.
Signed-off-by: Jiang Liu <jiang.liu@...ux.intel.com>
Tested-by: Joerg Roedel <joro@...tes.org>
Cc: Tony Luck <tony.luck@...el.com>
Cc: iommu@...ts.linux-foundation.org
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Yinghai Lu <yinghai@...nel.org>
Cc: Borislav Petkov <bp@...en8.de>
Link: http://lkml.kernel.org/r/1420615903-28253-15-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
drivers/iommu/irq_remapping.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
index e7449b4..7d85d2b 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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists