diff options
author | Joerg Roedel <joro@8bytes.org> | 2012-09-26 06:44:33 -0400 |
---|---|---|
committer | Joerg Roedel <joro@8bytes.org> | 2013-01-28 04:48:29 -0500 |
commit | 70733e0c7ed22177e2cfe660fa2a0e90f1f39126 (patch) | |
tree | c5e73c4c773dcfe8309f7b2734835f55495a9c15 /drivers/iommu | |
parent | 5ca72c4f7c412c2002363218901eba5516c476b1 (diff) |
x86, apic: Move irq_remapping_enabled checks into IRQ-remapping code
Move the three easy to move checks in the x86' apic.c file
into the IRQ-remapping code.
Signed-off-by: Joerg Roedel <joro@8bytes.org>
Acked-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/irq_remapping.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c index faf85d6e33fe..19381b90e619 100644 --- a/drivers/iommu/irq_remapping.c +++ b/drivers/iommu/irq_remapping.c | |||
@@ -87,7 +87,9 @@ int __init irq_remapping_enable(void) | |||
87 | 87 | ||
88 | void irq_remapping_disable(void) | 88 | void irq_remapping_disable(void) |
89 | { | 89 | { |
90 | if (!remap_ops || !remap_ops->disable) | 90 | if (!irq_remapping_enabled || |
91 | !remap_ops || | ||
92 | !remap_ops->disable) | ||
91 | return; | 93 | return; |
92 | 94 | ||
93 | remap_ops->disable(); | 95 | remap_ops->disable(); |
@@ -95,7 +97,9 @@ void irq_remapping_disable(void) | |||
95 | 97 | ||
96 | int irq_remapping_reenable(int mode) | 98 | int irq_remapping_reenable(int mode) |
97 | { | 99 | { |
98 | if (!remap_ops || !remap_ops->reenable) | 100 | if (!irq_remapping_enabled || |
101 | !remap_ops || | ||
102 | !remap_ops->reenable) | ||
99 | return 0; | 103 | return 0; |
100 | 104 | ||
101 | return remap_ops->reenable(mode); | 105 | return remap_ops->reenable(mode); |
@@ -103,6 +107,9 @@ int irq_remapping_reenable(int mode) | |||
103 | 107 | ||
104 | int __init irq_remap_enable_fault_handling(void) | 108 | int __init irq_remap_enable_fault_handling(void) |
105 | { | 109 | { |
110 | if (!irq_remapping_enabled) | ||
111 | return 0; | ||
112 | |||
106 | if (!remap_ops || !remap_ops->enable_faulting) | 113 | if (!remap_ops || !remap_ops->enable_faulting) |
107 | return -ENODEV; | 114 | return -ENODEV; |
108 | 115 | ||