From 96a621e01a42dc53848e2e4915fd807ebc1fc82f Mon Sep 17 00:00:00 2001
From: Mika Westerberg <mika.westerberg@linux.intel.com>
Date: Thu, 24 May 2018 15:10:21 -0500
Subject: [PATCH] PCI: shpchp: Remove get_hp_hw_control_from_firmware() wrapper
Git-commit: 96a621e01a42dc53848e2e4915fd807ebc1fc82f
Patch-mainline: v4.18
References: FATE#326302
get_hp_hw_control_from_firmware() is a trivial wrapper around
acpi_get_hp_hw_control_from_firmware(), probably intended to be generic in
case other firmware needed similar OS/platform negotiation.
Remove get_hp_hw_control_from_firmware() and call
acpi_get_hp_hw_control_from_firmware() directly. Add a stub for
acpi_get_hp_hw_control_from_firmware() for the non-ACPI case.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
drivers/pci/hotplug/shpchp.h | 10 ----------
drivers/pci/hotplug/shpchp_core.c | 2 +-
include/linux/pci_hotplug.h | 4 ++++
3 files changed, 5 insertions(+), 11 deletions(-)
--- a/drivers/pci/hotplug/shpchp.h
+++ b/drivers/pci/hotplug/shpchp.h
@@ -187,16 +187,6 @@ static inline const char *slot_name(stru
return hotplug_slot_name(slot->hotplug_slot);
}
-#ifdef CONFIG_ACPI
-#include <linux/pci-acpi.h>
-static inline int get_hp_hw_control_from_firmware(struct pci_dev *dev)
-{
- return acpi_get_hp_hw_control_from_firmware(dev);
-}
-#else
-#define get_hp_hw_control_from_firmware(dev) (0)
-#endif
-
struct ctrl_reg {
volatile u32 base_offset;
volatile u32 slot_avail1;
--- a/drivers/pci/hotplug/shpchp_core.c
+++ b/drivers/pci/hotplug/shpchp_core.c
@@ -291,7 +291,7 @@ static int is_shpc_capable(struct pci_de
return 1;
if (!pci_find_capability(dev, PCI_CAP_ID_SHPC))
return 0;
- if (get_hp_hw_control_from_firmware(dev))
+ if (acpi_get_hp_hw_control_from_firmware(dev))
return 0;
return 1;
}
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -186,6 +186,10 @@ static inline int pci_get_hp_params(stru
{
return -ENODEV;
}
+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; }
#endif
#endif