Commit 30969e34 authored by Jiang Liu's avatar Jiang Liu Committed by Thomas Gleixner

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: default avatarJiang Liu <jiang.liu@linux.intel.com>
Tested-by: default avatarJoerg Roedel <joro@8bytes.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: iommu@lists.linux-foundation.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Link: http://lkml.kernel.org/r/1420615903-28253-15-git-send-email-jiang.liu@linux.intel.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent c392f56c
...@@ -204,15 +204,15 @@ int __init irq_remapping_prepare(void) ...@@ -204,15 +204,15 @@ int __init irq_remapping_prepare(void)
if (disable_irq_remap) if (disable_irq_remap)
return -ENOSYS; return -ENOSYS;
remap_ops = &intel_irq_remap_ops; if (intel_irq_remap_ops.prepare() == 0)
remap_ops = &intel_irq_remap_ops;
#ifdef CONFIG_AMD_IOMMU else if (IS_ENABLED(CONFIG_AMD_IOMMU) &&
if (amd_iommu_irq_ops.prepare() == 0) { amd_iommu_irq_ops.prepare() == 0)
remap_ops = &amd_iommu_irq_ops; remap_ops = &amd_iommu_irq_ops;
return 0; else
} return -ENOSYS;
#endif
return remap_ops->prepare(); return 0;
} }
int __init irq_remapping_enable(void) int __init irq_remapping_enable(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment