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: 325656 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 049CF2C00C6 for ; Mon, 3 Mar 2014 11:04:38 +1100 (EST) 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 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)