ACPI: Allow CONFIG_PCI to be unset for reboot
authorSinan Kaya <okaya@kernel.org>
Wed, 19 Dec 2018 22:46:54 +0000 (22:46 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 20 Dec 2018 09:19:49 +0000 (10:19 +0100)
Make PCI reboot conditional on CONFIG_PCI set on the kernel configuration.

Signed-off-by: Sinan Kaya <okaya@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/reboot.c

index d642a9dede5263d30f04930cbc6be0b7886dcb8e..ca707f5b521d0990370e9f7fdbc531d97497cb4f 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/acpi.h>
 #include <acpi/reboot.h>
 
+#ifdef CONFIG_PCI
 static void acpi_pci_reboot(struct acpi_generic_address *rr, u8 reset_value)
 {
        unsigned int devfn;
@@ -21,6 +22,13 @@ static void acpi_pci_reboot(struct acpi_generic_address *rr, u8 reset_value)
        pci_bus_write_config_byte(bus0, devfn,
                        (rr->address & 0xffff), reset_value);
 }
+#else
+static inline void acpi_pci_reboot(struct acpi_generic_address *rr,
+                                  u8 reset_value)
+{
+       pr_warn_once("PCI configuration space access is not supported\n");
+}
+#endif
 
 void acpi_reboot(void)
 {