From patchwork Mon Mar 3 00:19:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 3750241 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3F101BF13A for ; Mon, 3 Mar 2014 00:04:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6CC712038C for ; Mon, 3 Mar 2014 00:04:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9569220364 for ; Mon, 3 Mar 2014 00:04:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754141AbaCCAEU (ORCPT ); Sun, 2 Mar 2014 19:04:20 -0500 Received: from v094114.home.net.pl ([79.96.170.134]:58328 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754139AbaCCAET (ORCPT ); Sun, 2 Mar 2014 19:04:19 -0500 Received: from afev49.neoplus.adsl.tpnet.pl [95.49.125.49] (HELO vostro.rjw.lan) by serwer1319399.home.pl [79.96.170.134] with SMTP (IdeaSmtpServer v0.80) id aac4779d155e465a; Mon, 3 Mar 2014 01:04:16 +0100 From: "Rafael J. Wysocki" To: Linux PCI Cc: ACPI Devel Maling List , Bjorn Helgaas , Linux Kernel Mailing List , Mika Westerberg Subject: [PATCH] ACPI / hotplug / PCI: Use pci_device_is_present() Date: Mon, 03 Mar 2014 01:19:25 +0100 Message-ID: <1505390.MlpMqG8COu@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/3.13.0+; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafael J. Wysocki Make the ACPI-based PCI hotplug (ACPIPHP) code use pci_device_is_present() for checking if devices are present instead of open coding the same thing. Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg --- On top of current linux-next. Thanks! --- drivers/pci/hotplug/acpiphp_glue.c | 7 ++----- 1 file changed, 2 insertions(+), 5 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 Index: linux-pm/drivers/pci/hotplug/acpiphp_glue.c =================================================================== --- linux-pm.orig/drivers/pci/hotplug/acpiphp_glue.c +++ linux-pm/drivers/pci/hotplug/acpiphp_glue.c @@ -668,12 +668,9 @@ static void trim_stale_devices(struct pc alive = (ACPI_SUCCESS(status) && device_status_valid(sta)) || acpiphp_no_hotplug(adev); } - if (!alive) { - u32 v; + if (!alive) + alive = pci_device_is_present(dev); - /* Check if the device responds. */ - alive = pci_bus_read_dev_vendor_id(dev->bus, dev->devfn, &v, 0); - } if (!alive) { pci_stop_and_remove_bus_device(dev); if (adev)