diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-05-07 11:44:08 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-05-16 08:05:19 -0400 |
commit | 59b47ddc0b4d7ea8a625512e802832730c1feeb4 (patch) | |
tree | eefb05672b47e7361724f55e8f26cd7f6ae71e88 /drivers | |
parent | 0a2db49dc4fe2873f857617d320c37b6bfe40255 (diff) |
x86: htirq: Use irq_alloc/free_irq()
No functional change, just cleaned up a bit.
This does not replace the requirement to move x86 to irq domains, but
it limits the mess to some degree.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Grant Likely <grant.likely@linaro.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: x86@kernel.org
Cc: linux-pci@vger.kernel.org
Link: http://lkml.kernel.org/r/20140507154335.452206351@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/htirq.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/pci/htirq.c b/drivers/pci/htirq.c index 6e373ea57b32..d68b030ab533 100644 --- a/drivers/pci/htirq.c +++ b/drivers/pci/htirq.c | |||
@@ -87,12 +87,9 @@ void unmask_ht_irq(struct irq_data *data) | |||
87 | int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update) | 87 | int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update) |
88 | { | 88 | { |
89 | struct ht_irq_cfg *cfg; | 89 | struct ht_irq_cfg *cfg; |
90 | int max_irq, pos, irq; | ||
90 | unsigned long flags; | 91 | unsigned long flags; |
91 | u32 data; | 92 | u32 data; |
92 | int max_irq; | ||
93 | int pos; | ||
94 | int irq; | ||
95 | int node; | ||
96 | 93 | ||
97 | pos = pci_find_ht_capability(dev, HT_CAPTYPE_IRQ); | 94 | pos = pci_find_ht_capability(dev, HT_CAPTYPE_IRQ); |
98 | if (!pos) | 95 | if (!pos) |
@@ -120,10 +117,8 @@ int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update) | |||
120 | cfg->msg.address_lo = 0xffffffff; | 117 | cfg->msg.address_lo = 0xffffffff; |
121 | cfg->msg.address_hi = 0xffffffff; | 118 | cfg->msg.address_hi = 0xffffffff; |
122 | 119 | ||
123 | node = dev_to_node(&dev->dev); | 120 | irq = irq_alloc_hwirq(dev_to_node(&dev->dev)); |
124 | irq = create_irq_nr(0, node); | 121 | if (!irq) { |
125 | |||
126 | if (irq <= 0) { | ||
127 | kfree(cfg); | 122 | kfree(cfg); |
128 | return -EBUSY; | 123 | return -EBUSY; |
129 | } | 124 | } |
@@ -166,7 +161,7 @@ void ht_destroy_irq(unsigned int irq) | |||
166 | cfg = irq_get_handler_data(irq); | 161 | cfg = irq_get_handler_data(irq); |
167 | irq_set_chip(irq, NULL); | 162 | irq_set_chip(irq, NULL); |
168 | irq_set_handler_data(irq, NULL); | 163 | irq_set_handler_data(irq, NULL); |
169 | destroy_irq(irq); | 164 | irq_free_hwirq(irq); |
170 | 165 | ||
171 | kfree(cfg); | 166 | kfree(cfg); |
172 | } | 167 | } |