aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-12-08 23:31:32 -0500
committerLen Brown <len.brown@intel.com>2008-12-30 21:47:30 -0500
commit74f82af1eda39c26c17f8030e4f60c00929ec9df (patch)
tree6904d7266caa59048e446af742505b64c51a0904 /drivers/acpi
parent4eaf6db3ea0edf7e011a613b5a15360444e58fec (diff)
ACPI: PCI: expand acpi_pci_allocate_irq() and acpi_pci_free_irq() inline
acpi_pci_allocate_irq() and acpi_pci_free_irq() are trivial and only used once, so just open-code them. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/pci_irq.c56
1 files changed, 13 insertions, 43 deletions
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 643c4e864298..03d528e02c29 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -299,44 +299,6 @@ void acpi_pci_irq_del_prt(int segment, int bus)
299/* -------------------------------------------------------------------------- 299/* --------------------------------------------------------------------------
300 PCI Interrupt Routing Support 300 PCI Interrupt Routing Support
301 -------------------------------------------------------------------------- */ 301 -------------------------------------------------------------------------- */
302static int
303acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
304 int *triggering, int *polarity, char **link)
305{
306 int irq;
307
308
309 if (entry->link) {
310 irq = acpi_pci_link_allocate_irq(entry->link, entry->index,
311 triggering, polarity, link);
312 if (irq < 0) {
313 printk(KERN_WARNING PREFIX
314 "Invalid IRQ link routing entry\n");
315 return -1;
316 }
317 } else {
318 irq = entry->index;
319 *triggering = ACPI_LEVEL_SENSITIVE;
320 *polarity = ACPI_ACTIVE_LOW;
321 }
322
323 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found GSI %d\n", irq));
324 return irq;
325}
326
327static int
328acpi_pci_free_irq(struct acpi_prt_entry *entry)
329{
330 int irq;
331
332 if (entry->link) {
333 irq = acpi_pci_link_free_irq(entry->link);
334 } else {
335 irq = entry->index;
336 }
337 return irq;
338}
339
340static struct acpi_prt_entry * 302static struct acpi_prt_entry *
341acpi_pci_irq_lookup(struct pci_dev *dev, int pin) 303acpi_pci_irq_lookup(struct pci_dev *dev, int pin)
342{ 304{
@@ -426,10 +388,15 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
426 return 0; 388 return 0;
427 } 389 }
428 390
429 if (entry) 391 if (entry) {
430 gsi = acpi_pci_allocate_irq(entry, &triggering, &polarity, 392 if (entry->link)
431 &link); 393 gsi = acpi_pci_link_allocate_irq(entry->link,
432 else 394 entry->index,
395 &triggering, &polarity,
396 &link);
397 else
398 gsi = entry->index;
399 } else
433 gsi = -1; 400 gsi = -1;
434 401
435 /* 402 /*
@@ -491,7 +458,10 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
491 if (!entry) 458 if (!entry)
492 return; 459 return;
493 460
494 gsi = acpi_pci_free_irq(entry); 461 if (entry->link)
462 gsi = acpi_pci_link_free_irq(entry->link);
463 else
464 gsi = entry->index;
495 465
496 /* 466 /*
497 * TBD: It might be worth clearing dev->irq by magic constant 467 * TBD: It might be worth clearing dev->irq by magic constant