From patchwork Tue Jun 2 15:25:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Chiang X-Patchwork-Id: 27513 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 n52FQBnL013116 for ; Tue, 2 Jun 2009 15:26:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757928AbZFBPZY (ORCPT ); Tue, 2 Jun 2009 11:25:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757949AbZFBPZY (ORCPT ); Tue, 2 Jun 2009 11:25:24 -0400 Received: from g1t0027.austin.hp.com ([15.216.28.34]:8118 "EHLO g1t0027.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757928AbZFBPZW (ORCPT ); Tue, 2 Jun 2009 11:25:22 -0400 Received: from smtp1.fc.hp.com (smtp1.fc.hp.com [15.15.136.127]) by g1t0027.austin.hp.com (Postfix) with ESMTP id 47709380F4; Tue, 2 Jun 2009 15:25:24 +0000 (UTC) Received: from localhost.localdomain (lart.fc.hp.com [15.11.146.31]) by smtp1.fc.hp.com (Postfix) with ESMTP id BF763254371; Tue, 2 Jun 2009 14:50:57 +0000 (UTC) Received: from bob.kio (localhost [127.0.0.1]) by localhost.localdomain (Postfix) with ESMTP id F3B6026142; Tue, 2 Jun 2009 09:25:21 -0600 (MDT) Subject: [PATCH 09/10] ACPI: simplify acpi_pci_irq_del_prt() API To: lenb@kernel.org From: Alex Chiang Cc: linux-acpi@vger.kernel.org, Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Date: Tue, 02 Jun 2009 09:25:21 -0600 Message-ID: <20090602152521.7346.20512.stgit@bob.kio> In-Reply-To: <20090602152351.7346.48697.stgit@bob.kio> References: <20090602152351.7346.48697.stgit@bob.kio> User-Agent: StGit/0.14.3.347.g594a MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org There is no need to pass a segment/bus tuple to this API, as the callsite always has a struct pci_bus. We can derive segment/bus from the struct pci_bus, so let's take this opportunit to simplify the API and make life easier for the callers. Cc: Bjorn Helgaas Signed-off-by: Alex Chiang --- drivers/acpi/pci_bind.c | 3 +-- drivers/acpi/pci_irq.c | 7 ++++--- include/acpi/acpi_drivers.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/pci_bind.c b/drivers/acpi/pci_bind.c index 96264d2..9185b54 100644 --- a/drivers/acpi/pci_bind.c +++ b/drivers/acpi/pci_bind.c @@ -127,8 +127,7 @@ static int acpi_pci_unbind(struct acpi_device *device) return 0; if (dev->subordinate) - acpi_pci_irq_del_prt(pci_domain_nr(dev->bus), - dev->subordinate->number); + acpi_pci_irq_del_prt(dev->subordinate); return 0; } diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 3ed944c..ef9509e 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c @@ -280,16 +280,17 @@ int acpi_pci_irq_add_prt(acpi_handle handle, struct pci_bus *bus) return 0; } -void acpi_pci_irq_del_prt(int segment, int bus) +void acpi_pci_irq_del_prt(struct pci_bus *bus) { struct acpi_prt_entry *entry, *tmp; printk(KERN_DEBUG "ACPI: Delete PCI Interrupt Routing Table for %04x:%02x\n", - segment, bus); + pci_domain_nr(bus), bus->number); spin_lock(&acpi_prt_lock); list_for_each_entry_safe(entry, tmp, &acpi_prt_list, list) { - if (segment == entry->id.segment && bus == entry->id.bus) { + if (pci_domain_nr(bus) == entry->id.segment + && bus->number == entry->id.bus) { list_del(&entry->list); kfree(entry); } diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index c21d83f..f4906f6 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -91,7 +91,7 @@ int acpi_pci_link_free_irq(acpi_handle handle); /* ACPI PCI Interrupt Routing (pci_irq.c) */ int acpi_pci_irq_add_prt(acpi_handle handle, struct pci_bus *bus); -void acpi_pci_irq_del_prt(int segment, int bus); +void acpi_pci_irq_del_prt(struct pci_bus *bus); /* ACPI PCI Device Binding (pci_bind.c) */