aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/irqchip/irq-armada-370-xp.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-04-29 13:23:22 -0400
committerThomas Gleixner <tglx@linutronix.de>2014-04-29 13:23:22 -0400
commit0a1f83ac64c32220a45fbe315115edc0c19dc989 (patch)
tree3b95f8fc03c56c25930a99f9a5fa485230592586 /drivers/irqchip/irq-armada-370-xp.c
parent3894e9e82dfdc87fa35dc7976e0472d220228826 (diff)
parentff3c664505bf8a8334bca5045e87b85cfe4d2277 (diff)
Merge tag 'mvebu-irqchip-fixes-3.15' of git://git.infradead.org/linux-mvebu into irq/urgent
Bugfixes for armada-370-xp SoC from Jason Cooper: * Fix invalid cast (signed to unsigned) * Add missing ->check_device() msi_chip op * Fix releasing of MSIs
Diffstat (limited to 'drivers/irqchip/irq-armada-370-xp.c')
-rw-r--r--drivers/irqchip/irq-armada-370-xp.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index 304a20d0ad15..3899ba7821c5 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -133,8 +133,7 @@ static int armada_370_xp_setup_msi_irq(struct msi_chip *chip,
133 struct msi_desc *desc) 133 struct msi_desc *desc)
134{ 134{
135 struct msi_msg msg; 135 struct msi_msg msg;
136 irq_hw_number_t hwirq; 136 int virq, hwirq;
137 int virq;
138 137
139 hwirq = armada_370_xp_alloc_msi(); 138 hwirq = armada_370_xp_alloc_msi();
140 if (hwirq < 0) 139 if (hwirq < 0)
@@ -160,8 +159,19 @@ static void armada_370_xp_teardown_msi_irq(struct msi_chip *chip,
160 unsigned int irq) 159 unsigned int irq)
161{ 160{
162 struct irq_data *d = irq_get_irq_data(irq); 161 struct irq_data *d = irq_get_irq_data(irq);
162 unsigned long hwirq = d->hwirq;
163
163 irq_dispose_mapping(irq); 164 irq_dispose_mapping(irq);
164 armada_370_xp_free_msi(d->hwirq); 165 armada_370_xp_free_msi(hwirq);
166}
167
168static int armada_370_xp_check_msi_device(struct msi_chip *chip, struct pci_dev *dev,
169 int nvec, int type)
170{
171 /* We support MSI, but not MSI-X */
172 if (type == PCI_CAP_ID_MSI)
173 return 0;
174 return -EINVAL;
165} 175}
166 176
167static struct irq_chip armada_370_xp_msi_irq_chip = { 177static struct irq_chip armada_370_xp_msi_irq_chip = {
@@ -202,6 +212,7 @@ static int armada_370_xp_msi_init(struct device_node *node,
202 212
203 msi_chip->setup_irq = armada_370_xp_setup_msi_irq; 213 msi_chip->setup_irq = armada_370_xp_setup_msi_irq;
204 msi_chip->teardown_irq = armada_370_xp_teardown_msi_irq; 214 msi_chip->teardown_irq = armada_370_xp_teardown_msi_irq;
215 msi_chip->check_device = armada_370_xp_check_msi_device;
205 msi_chip->of_node = node; 216 msi_chip->of_node = node;
206 217
207 armada_370_xp_msi_domain = 218 armada_370_xp_msi_domain =