summaryrefslogtreecommitdiff
path: root/drivers/acpi/pci_irq.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-12-08 21:31:32 -0700
committerLen Brown <len.brown@intel.com>2008-12-30 21:47:30 -0500
commit74f82af1eda39c26c17f8030e4f60c00929ec9df (patch)
tree6904d7266caa59048e446af742505b64c51a0904 /drivers/acpi/pci_irq.c
parent4eaf6db3ea0edf7e011a613b5a15360444e58fec (diff)
downloadlinux-74f82af1eda39c26c17f8030e4f60c00929ec9df.tar.gz
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/pci_irq.c')
-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)
/* --------------------------------------------------------------------------
PCI Interrupt Routing Support
-------------------------------------------------------------------------- */
-static int
-acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
- int *triggering, int *polarity, char **link)
-{
- int irq;
-
-
- if (entry->link) {
- irq = acpi_pci_link_allocate_irq(entry->link, entry->index,
- triggering, polarity, link);
- if (irq < 0) {
- printk(KERN_WARNING PREFIX
- "Invalid IRQ link routing entry\n");
- return -1;
- }
- } else {
- irq = entry->index;
- *triggering = ACPI_LEVEL_SENSITIVE;
- *polarity = ACPI_ACTIVE_LOW;
- }
-
- ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found GSI %d\n", irq));
- return irq;
-}
-
-static int
-acpi_pci_free_irq(struct acpi_prt_entry *entry)
-{
- int irq;
-
- if (entry->link) {
- irq = acpi_pci_link_free_irq(entry->link);
- } else {
- irq = entry->index;
- }
- return irq;
-}
-
static struct acpi_prt_entry *
acpi_pci_irq_lookup(struct pci_dev *dev, int pin)
{
@@ -426,10 +388,15 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
return 0;
}
- if (entry)
- gsi = acpi_pci_allocate_irq(entry, &triggering, &polarity,
- &link);
- else
+ if (entry) {
+ if (entry->link)
+ gsi = acpi_pci_link_allocate_irq(entry->link,
+ entry->index,
+ &triggering, &polarity,
+ &link);
+ else
+ gsi = entry->index;
+ } else
gsi = -1;
/*
@@ -491,7 +458,10 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
if (!entry)
return;
- gsi = acpi_pci_free_irq(entry);
+ if (entry->link)
+ gsi = acpi_pci_link_free_irq(entry->link);
+ else
+ gsi = entry->index;
/*
* TBD: It might be worth clearing dev->irq by magic constant