diff mbox

[v8,3/7] PCI: Introduce hotplug_is_native()

Message ID 20180528124756.78512-4-mika.westerberg@linux.intel.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Mika Westerberg May 28, 2018, 12:47 p.m. UTC
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 <mika.westerberg@linux.intel.com>
---
 include/linux/pci_hotplug.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Rafael J. Wysocki May 29, 2018, 9:06 a.m. UTC | #1
On Monday, May 28, 2018 2:47:52 PM CEST Mika Westerberg wrote:
> 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 <mika.westerberg@linux.intel.com>

Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

> ---
>  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
>
Andy Shevchenko May 29, 2018, 4:34 p.m. UTC | #2
On Mon, 2018-05-28 at 15:47 +0300, Mika Westerberg wrote:
> This helper function can be used for finding out whether the OS is
> supposed to handle native hotplug of a given bridge.
> 

Nice simple helper.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> ---
>  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
diff mbox

Patch

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