lkml.org 
[lkml]   [2018]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH v1 4/4] PCI: hotplug: Implement hotplug_is_native() only when CONFIG_ACPI=y
From
Date
From: Bjorn Helgaas <bhelgaas@google.com>

hotplug_is_native() is used only by the acpiphp driver, so we only need to
implement the interface when CONFIG_ACPI=y.

Move the implementation under #ifdef CONFIG_ACPI and drop the unnecessary
stubs for the non-ACPI case.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
include/linux/pci_hotplug.h | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index f08a44e1606f..09eb40299c37 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -9,7 +9,6 @@
* All rights reserved.
*
* Send feedback to <kristen.c.accardi@intel.com>
- *
*/
#ifndef _PCI_HOTPLUG_H
#define _PCI_HOTPLUG_H
@@ -171,6 +170,11 @@ static inline bool shpchp_is_native(struct pci_dev *bridge)
{
return bridge->shpc_managed;
}
+
+static inline bool hotplug_is_native(struct pci_dev *bridge)
+{
+ return pciehp_is_native(bridge) || shpchp_is_native(bridge);
+}
#else
static inline int pci_get_hp_params(struct pci_dev *dev,
struct hotplug_params *hpp)
@@ -182,12 +186,6 @@ static inline int acpi_get_hp_hw_control_from_firmware(struct pci_dev *bridge)
{
return 0;
}
-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
\
 
 \ /
  Last update: 2018-06-26 01:00    [W:0.113 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site