From patchwork Wed Aug 26 23:20:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 44145 X-Patchwork-Delegate: bhelgaas@google.com 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 n7QNKYZJ005558 for ; Wed, 26 Aug 2009 23:20:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753508AbZHZXUq (ORCPT ); Wed, 26 Aug 2009 19:20:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753509AbZHZXUq (ORCPT ); Wed, 26 Aug 2009 19:20:46 -0400 Received: from g1t0028.austin.hp.com ([15.216.28.35]:4973 "EHLO g1t0028.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753508AbZHZXUp (ORCPT ); Wed, 26 Aug 2009 19:20:45 -0400 Received: from g1t0038.austin.hp.com (g1t0038.austin.hp.com [16.236.32.44]) by g1t0028.austin.hp.com (Postfix) with ESMTP id 0310F1C66A; Wed, 26 Aug 2009 23:20:47 +0000 (UTC) Received: from ldl (linux.corp.hp.com [15.11.146.101]) by g1t0038.austin.hp.com (Postfix) with ESMTP id B7BFF3008D; Wed, 26 Aug 2009 23:20:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ldl (Postfix) with ESMTP id A49B3CF001B; Wed, 26 Aug 2009 17:20:47 -0600 (MDT) Received: from ldl ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jhX5MLfw6IRu; Wed, 26 Aug 2009 17:20:47 -0600 (MDT) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl (Postfix) with ESMTP id 8EFE3CF000E; Wed, 26 Aug 2009 17:20:47 -0600 (MDT) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id 686A626142; Wed, 26 Aug 2009 17:20:51 -0600 (MDT) Subject: [PATCH 3/8] PCI hotplug: rename acpi_get_hp_params_from_firmware() to acpi_get_hp_params() To: Kristen Carlson Accardi From: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Gary Hade , Kenji Kaneshige Date: Wed, 26 Aug 2009 17:20:51 -0600 Message-ID: <20090826232051.20840.75176.stgit@bob.kio> In-Reply-To: <20090826231949.20840.99949.stgit@bob.kio> References: <20090826231949.20840.99949.stgit@bob.kio> User-Agent: StGit/0.14.3.386.gb02d MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org This patch renames acpi_get_hp_params_from_firmware() to acpi_get_hp_params() (of course the parameters are from firmware; where else would ACPI get them?), makes it take a pci_dev rather than a pci_bus, and makes it return a standard int errno rather than acpi_status. Signed-off-by: Bjorn Helgaas Reviewed-by: Alex Chiang --- drivers/pci/hotplug/acpi_pcihp.c | 19 +++++++++---------- drivers/pci/hotplug/acpiphp_glue.c | 7 +++---- drivers/pci/hotplug/pciehp.h | 4 +--- drivers/pci/hotplug/shpchp.h | 4 +--- include/linux/pci_hotplug.h | 3 +-- 5 files changed, 15 insertions(+), 22 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/pci/hotplug/acpi_pcihp.c b/drivers/pci/hotplug/acpi_pcihp.c index eb15958..5a448ad 100644 --- a/drivers/pci/hotplug/acpi_pcihp.c +++ b/drivers/pci/hotplug/acpi_pcihp.c @@ -322,20 +322,19 @@ static acpi_status acpi_run_oshp(acpi_handle handle) return status; } -/* acpi_get_hp_params_from_firmware +/* acpi_get_hp_params * - * @bus - the pci_bus of the bus on which the device is newly added + * @dev - the pci_dev for which we want parameters * @hpp - allocated by the caller */ -acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, - struct hotplug_params *hpp) +int acpi_get_hp_params(struct pci_dev *dev, struct hotplug_params *hpp) { - acpi_status status = AE_NOT_FOUND; + acpi_status status; acpi_handle handle, phandle; struct pci_bus *pbus; handle = NULL; - for (pbus = bus; pbus; pbus = pbus->parent) { + for (pbus = dev->bus; pbus; pbus = pbus->parent) { handle = acpi_pci_get_bridge_handle(pbus); if (handle) break; @@ -350,10 +349,10 @@ acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, while (handle) { status = acpi_run_hpx(handle, hpp); if (ACPI_SUCCESS(status)) - break; + return 0; status = acpi_run_hpp(handle, hpp); if (ACPI_SUCCESS(status)) - break; + return 0; if (acpi_is_root_bridge(handle)) break; status = acpi_get_parent(handle, &phandle); @@ -361,9 +360,9 @@ acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, break; handle = phandle; } - return status; + return -ENODEV; } -EXPORT_SYMBOL_GPL(acpi_get_hp_params_from_firmware); +EXPORT_SYMBOL_GPL(acpi_get_hp_params); /** * acpi_get_hp_hw_control_from_firmware diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 1eec666..71c3e16 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -278,11 +278,10 @@ static int detect_ejectable_slots(struct pci_bus *pbus) /* decode ACPI 2.0 _HPP hot plug parameters */ static void decode_hpp(struct pci_dev *dev, struct hotplug_params *hpp) { - acpi_status status; + int ret; - status = acpi_get_hp_params_from_firmware(dev->bus, hpp); - if (ACPI_FAILURE(status) || - !hpp->t0 || (hpp->t0->revision > 1)) { + ret = acpi_get_hp_params(dev, hpp); + if (ret || !hpp->t0 || (hpp->t0->revision > 1)) { /* use default numbers */ printk(KERN_WARNING "%s: Could not get hotplug parameters. Use defaults\n", diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index e6cf096..0eda01e 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h @@ -241,9 +241,7 @@ static inline int pciehp_get_hp_hw_control_from_firmware(struct pci_dev *dev) static inline int pciehp_get_hp_params_from_firmware(struct pci_dev *dev, struct hotplug_params *hpp) { - if (ACPI_FAILURE(acpi_get_hp_params_from_firmware(dev->bus, hpp))) - return -ENODEV; - return 0; + return acpi_get_hp_params(dev, hpp); } #else #define pciehp_firmware_init() do {} while (0) diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h index 974e924..49bd2d7 100644 --- a/drivers/pci/hotplug/shpchp.h +++ b/drivers/pci/hotplug/shpchp.h @@ -191,9 +191,7 @@ static inline const char *slot_name(struct slot *slot) static inline int get_hp_params_from_firmware(struct pci_dev *dev, struct hotplug_params *hpp) { - if (ACPI_FAILURE(acpi_get_hp_params_from_firmware(dev->bus, hpp))) - return -ENODEV; - return 0; + return acpi_get_hp_params(dev, hpp); } static inline int get_hp_hw_control_from_firmware(struct pci_dev *dev) diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index 4391741..0f3e1db 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h @@ -226,8 +226,7 @@ struct hotplug_params { #ifdef CONFIG_ACPI #include #include -extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, - struct hotplug_params *hpp); +int acpi_get_hp_params(struct pci_dev *dev, struct hotplug_params *hpp); int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags); int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); int acpi_pci_detect_ejectable(struct pci_bus *pbus);