From patchwork Wed Jun 10 19:55:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Chiang X-Patchwork-Id: 29372 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 n5AJvd4X003381 for ; Wed, 10 Jun 2009 19:57:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761498AbZFJTzl (ORCPT ); Wed, 10 Jun 2009 15:55:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761493AbZFJTzl (ORCPT ); Wed, 10 Jun 2009 15:55:41 -0400 Received: from g1t0029.austin.hp.com ([15.216.28.36]:16149 "EHLO g1t0029.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760454AbZFJTzh (ORCPT ); Wed, 10 Jun 2009 15:55:37 -0400 Received: from smtp1.fc.hp.com (smtp1.fc.hp.com [15.15.136.127]) by g1t0029.austin.hp.com (Postfix) with ESMTP id C071F3836A; Wed, 10 Jun 2009 19:55:40 +0000 (UTC) Received: from localhost.localdomain (lart.fc.hp.com [15.11.146.31]) by smtp1.fc.hp.com (Postfix) with ESMTP id 70616255225; Wed, 10 Jun 2009 19:20:38 +0000 (UTC) Received: from bob.kio (localhost [127.0.0.1]) by localhost.localdomain (Postfix) with ESMTP id 71F1D2615B; Wed, 10 Jun 2009 13:55:40 -0600 (MDT) Subject: [PATCH v3 07/12] 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: Wed, 10 Jun 2009 13:55:40 -0600 Message-ID: <20090610195540.28982.98463.stgit@bob.kio> In-Reply-To: <20090610194714.28982.51363.stgit@bob.kio> References: <20090610194714.28982.51363.stgit@bob.kio> User-Agent: StGit/0.14.3.347.g594a MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@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-acpi" 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 6eb58ef..62cb383 100644 --- a/drivers/acpi/pci_bind.c +++ b/drivers/acpi/pci_bind.c @@ -113,8 +113,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); pci_dev_put(dev); 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 702b12e..12e99c3 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) */