diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2010-10-04 10:51:27 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-10-12 10:53:41 -0400 |
commit | a8ef54aeb4308d3730ff31807c495390b98de16a (patch) | |
tree | 09e6af4cb4af33edf141585f539be6a6e787b9ba /drivers/pci | |
parent | 0e1e367aab873becf3e21d9b0cf46d11154ebc3f (diff) |
pci: intr_remap: Use irq_data
No need to dereference irq_desc.
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>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/intr_remapping.c | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c index 87ec390e10df..cb6252988546 100644 --- a/drivers/pci/intr_remapping.c +++ b/drivers/pci/intr_remapping.c | |||
@@ -54,45 +54,22 @@ struct irq_2_iommu { | |||
54 | }; | 54 | }; |
55 | 55 | ||
56 | #ifdef CONFIG_GENERIC_HARDIRQS | 56 | #ifdef CONFIG_GENERIC_HARDIRQS |
57 | static struct irq_2_iommu *get_one_free_irq_2_iommu(int node) | ||
58 | { | ||
59 | struct irq_2_iommu *iommu; | ||
60 | |||
61 | iommu = kzalloc_node(sizeof(*iommu), GFP_ATOMIC, node); | ||
62 | printk(KERN_DEBUG "alloc irq_2_iommu on node %d\n", node); | ||
63 | |||
64 | return iommu; | ||
65 | } | ||
66 | |||
67 | static struct irq_2_iommu *irq_2_iommu(unsigned int irq) | 57 | static struct irq_2_iommu *irq_2_iommu(unsigned int irq) |
68 | { | 58 | { |
69 | struct irq_desc *desc; | 59 | return get_irq_iommu(irq); |
70 | |||
71 | desc = irq_to_desc(irq); | ||
72 | |||
73 | if (WARN_ON_ONCE(!desc)) | ||
74 | return NULL; | ||
75 | |||
76 | return desc->irq_2_iommu; | ||
77 | } | 60 | } |
78 | 61 | ||
79 | static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq) | 62 | static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq) |
80 | { | 63 | { |
81 | struct irq_desc *desc; | 64 | struct irq_data *data = irq_get_irq_data(irq); |
82 | struct irq_2_iommu *irq_iommu; | ||
83 | 65 | ||
84 | desc = irq_to_desc(irq); | 66 | if (WARN_ONCE(data->irq_2_iommu, |
85 | if (!desc) { | 67 | KERN_DEBUG "irq_2_iommu!=NULL irq %u\n", irq)) |
86 | printk(KERN_INFO "can not get irq_desc for %d\n", irq); | 68 | return data->irq_2_iommu; |
87 | return NULL; | ||
88 | } | ||
89 | |||
90 | irq_iommu = desc->irq_2_iommu; | ||
91 | |||
92 | if (!irq_iommu) | ||
93 | desc->irq_2_iommu = get_one_free_irq_2_iommu(irq_node(irq)); | ||
94 | 69 | ||
95 | return desc->irq_2_iommu; | 70 | data->irq_2_iommu = kzalloc_node(sizeof(*data->irq_2_iommu), |
71 | GFP_ATOMIC, data->node); | ||
72 | return data->irq_2_iommu; | ||
96 | } | 73 | } |
97 | 74 | ||
98 | static void irq_2_iommu_free(unsigned int irq) | 75 | static void irq_2_iommu_free(unsigned int irq) |