summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-10-10 12:29:27 +0200
committerThomas Gleixner <tglx@linutronix.de>2010-10-12 16:53:41 +0200
commit349d67673c08cbc299a69086b0f5447cf1094e9b (patch)
tree6598e36307508626d8c8e6661787f6b9e842cdaf
parent423f085952fd7253407cb92984cc2d495a564481 (diff)
downloadtalos-obmc-linux-349d67673c08cbc299a69086b0f5447cf1094e9b.tar.gz
talos-obmc-linux-349d67673c08cbc299a69086b0f5447cf1094e9b.zip
intr_remap: Use irq_2_iommu in struct irq_cfg
Switch the intr_remapping code to use the irq_2_iommu struct in irg_cfg. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Ingo Molnar <mingo@elte.hu> Acked-by: Suresh Siddha <suresh.b.siddha@intel.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r--drivers/pci/intr_remapping.c39
1 files changed, 3 insertions, 36 deletions
diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
index 0f4691c5fab3..ea46935422ff 100644
--- a/drivers/pci/intr_remapping.c
+++ b/drivers/pci/intr_remapping.c
@@ -46,54 +46,21 @@ static __init int setup_intremap(char *str)
}
early_param("intremap", setup_intremap);
-#ifdef CONFIG_GENERIC_HARDIRQS
static struct irq_2_iommu *irq_2_iommu(unsigned int irq)
{
- return get_irq_iommu(irq);
+ struct irq_cfg *cfg = get_irq_chip_data(irq);
+ return cfg ? &cfg->irq_2_iommu : NULL;
}
static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq)
{
- struct irq_data *data = irq_get_irq_data(irq);
-
- if (WARN_ONCE(data->irq_2_iommu,
- KERN_DEBUG "irq_2_iommu!=NULL irq %u\n", irq))
- return data->irq_2_iommu;
-
- data->irq_2_iommu = kzalloc_node(sizeof(*data->irq_2_iommu),
- GFP_ATOMIC, data->node);
- return data->irq_2_iommu;
+ return irq_2_iommu(irq);
}
static void irq_2_iommu_free(unsigned int irq)
{
- struct irq_data *d = irq_get_irq_data(irq);
- struct irq_2_iommu *p = d->irq_2_iommu;
-
- d->irq_2_iommu = NULL;
- kfree(p);
}
-#else /* !CONFIG_SPARSE_IRQ */
-
-static struct irq_2_iommu irq_2_iommuX[NR_IRQS];
-
-static struct irq_2_iommu *irq_2_iommu(unsigned int irq)
-{
- if (irq < nr_irqs)
- return &irq_2_iommuX[irq];
-
- return NULL;
-}
-static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq)
-{
- return irq_2_iommu(irq);
-}
-
-static void irq_2_iommu_free(unsigned int irq) { }
-
-#endif
-
static DEFINE_SPINLOCK(irq_2_ir_lock);
static struct irq_2_iommu *valid_irq_2_iommu(unsigned int irq)
OpenPOWER on IntegriCloud