From patchwork Mon May 28 12:47:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 10432347 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CCD3C601BE for ; Mon, 28 May 2018 12:48:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCCCC28C82 for ; Mon, 28 May 2018 12:48:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0AF128CBA; Mon, 28 May 2018 12:48:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D87328C82 for ; Mon, 28 May 2018 12:48:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937826AbeE1MsD (ORCPT ); Mon, 28 May 2018 08:48:03 -0400 Received: from mga12.intel.com ([192.55.52.136]:49900 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937615AbeE1MsB (ORCPT ); Mon, 28 May 2018 08:48:01 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2018 05:48:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,452,1520924400"; d="scan'208";a="203283444" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 28 May 2018 05:47:57 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id CB5F02C2; Mon, 28 May 2018 15:47:56 +0300 (EEST) From: Mika Westerberg To: Bjorn Helgaas , "Rafael J . Wysocki" Cc: Len Brown , Mario.Limonciello@dell.com, Michael Jamet , Yehezkel Bernat , Andy Shevchenko , Lukas Wunner , Mika Westerberg , linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org Subject: [PATCH v8 3/7] PCI: Introduce hotplug_is_native() Date: Mon, 28 May 2018 15:47:52 +0300 Message-Id: <20180528124756.78512-4-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528124756.78512-1-mika.westerberg@linux.intel.com> References: <20180528124756.78512-1-mika.westerberg@linux.intel.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This helper function can be used for finding out whether the OS is supposed to handle native hotplug of a given bridge. Signed-off-by: Mika Westerberg Reviewed-by: Rafael J. Wysocki Reviewed-by: Andy Shevchenko --- include/linux/pci_hotplug.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index 4c378368215c..cf5e22103f68 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h @@ -181,4 +181,9 @@ static inline int acpi_get_hp_hw_control_from_firmware(struct pci_dev *bridge) static inline bool pciehp_is_native(struct pci_dev *bridge) { return true; } static inline bool shpchp_is_native(struct pci_dev *bridge) { return true; } #endif + +static inline bool hotplug_is_native(struct pci_dev *bridge) +{ + return pciehp_is_native(bridge) || shpchp_is_native(bridge); +} #endif