From patchwork Fri Jan 9 09:26:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 1519 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n099Pe6c003470 for ; Fri, 9 Jan 2009 01:25:45 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756084AbZAIJ31 (ORCPT ); Fri, 9 Jan 2009 04:29:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753884AbZAIJ3R (ORCPT ); Fri, 9 Jan 2009 04:29:17 -0500 Received: from vms173007pub.verizon.net ([206.46.173.7]:56372 "EHLO vms173007pub.verizon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753907AbZAIJ2c (ORCPT ); Fri, 9 Jan 2009 04:28:32 -0500 Received: from localhost.localdomain ([96.237.168.40]) by vms173007.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0KD700HTF68UX1F2@vms173007.mailsrvcs.net> for linux-acpi@vger.kernel.org; Fri, 09 Jan 2009 03:26:55 -0600 (CST) Received: from localhost.localdomain (d975xbx2 [127.0.0.1]) by localhost.localdomain (8.14.2/8.14.2) with ESMTP id n099SG5Z012023; Fri, 09 Jan 2009 04:28:16 -0500 Received: (from lenb@localhost) by localhost.localdomain (8.14.2/8.14.2/Submit) id n099SGlt012022; Fri, 09 Jan 2009 04:28:16 -0500 Date: Fri, 09 Jan 2009 04:26:58 -0500 From: Len Brown Subject: [PATCH 56/94] ACPI: PCI: expand acpi_pci_allocate_irq() and acpi_pci_free_irq() inline In-reply-to: <1231493256-11678-1-git-send-email-lenb@kernel.org> In-reply-to: To: linux-acpi@vger.kernel.org Cc: Bjorn Helgaas , Len Brown Message-id: <74f82af1eda39c26c17f8030e4f60c00929ec9df.1231492610.git.len.brown@intel.com> Organization: Intel Open Source Technology Center X-Mailer: git-send-email 1.6.1.76.gc123b References: <1231493256-11678-1-git-send-email-lenb@kernel.org> References: Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Bjorn Helgaas 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 Signed-off-by: Len Brown --- drivers/acpi/pci_irq.c | 56 +++++++++++------------------------------------ 1 files changed, 13 insertions(+), 43 deletions(-) diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 643c4e8..03d528e 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