diff options
Diffstat (limited to 'drivers/pci/intr_remapping.c')
-rw-r--r-- | drivers/pci/intr_remapping.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c index 23372c811159..2dcf973890c4 100644 --- a/drivers/pci/intr_remapping.c +++ b/drivers/pci/intr_remapping.c | |||
@@ -76,9 +76,10 @@ static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq) | |||
76 | struct irq_desc *desc; | 76 | struct irq_desc *desc; |
77 | struct irq_2_iommu *irq_iommu; | 77 | struct irq_2_iommu *irq_iommu; |
78 | 78 | ||
79 | desc = irq_to_desc(irq); | 79 | /* |
80 | 80 | * alloc irq desc if not allocated already. | |
81 | BUG_ON(!desc); | 81 | */ |
82 | desc = irq_to_desc_alloc(irq); | ||
82 | 83 | ||
83 | irq_iommu = desc->irq_2_iommu; | 84 | irq_iommu = desc->irq_2_iommu; |
84 | 85 | ||
@@ -255,11 +256,8 @@ int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, u16 subhandle) | |||
255 | struct irq_2_iommu *irq_iommu; | 256 | struct irq_2_iommu *irq_iommu; |
256 | 257 | ||
257 | spin_lock(&irq_2_ir_lock); | 258 | spin_lock(&irq_2_ir_lock); |
258 | irq_iommu = valid_irq_2_iommu(irq); | 259 | |
259 | if (!irq_iommu) { | 260 | irq_iommu = irq_2_iommu_alloc(irq); |
260 | spin_unlock(&irq_2_ir_lock); | ||
261 | return -1; | ||
262 | } | ||
263 | 261 | ||
264 | irq_iommu->iommu = iommu; | 262 | irq_iommu->iommu = iommu; |
265 | irq_iommu->irte_index = index; | 263 | irq_iommu->irte_index = index; |