From: Takashi Iwai <tiwai@suse.de>
Subject: kABI workaround for pcie_port_bus_type change
Patch-mainline: Never, kABI workaround
References: bsc#1161561
patches.suse/PCI-portdrv-Remove-pcie_port_bus_type-link-order-dep.patch
moved pcie_port_bus_type definition into pci-driver.c, and this broke
kABI. Take it back to generate the compatible kABI again.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
drivers/pci/pci-driver.c | 8 +-------
drivers/pci/pcie/Makefile | 2 +-
drivers/pci/pcie/portdrv_bus.c | 15 +++++++++++++++
3 files changed, 17 insertions(+), 8 deletions(-)
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -1639,7 +1639,7 @@ struct bus_type pci_bus_type = {
EXPORT_SYMBOL(pci_bus_type);
#ifdef CONFIG_PCIEPORTBUS
-static int pcie_port_bus_match(struct device *dev, struct device_driver *drv)
+int pcie_port_bus_match(struct device *dev, struct device_driver *drv)
{
struct pcie_device *pciedev;
struct pcie_port_service_driver *driver;
@@ -1659,12 +1659,6 @@ static int pcie_port_bus_match(struct de
return 1;
}
-
-struct bus_type pcie_port_bus_type = {
- .name = "pci_express",
- .match = pcie_port_bus_match,
-};
-EXPORT_SYMBOL_GPL(pcie_port_bus_type);
#endif
static int __init pci_driver_init(void)
--- a/drivers/pci/pcie/Makefile
+++ b/drivers/pci/pcie/Makefile
@@ -5,7 +5,7 @@
# Build PCI Express ASPM if needed
obj-$(CONFIG_PCIEASPM) += aspm.o
-pcieportdrv-y := portdrv_core.o portdrv_pci.o err.o
+pcieportdrv-y := portdrv_core.o portdrv_pci.o err.o portdrv_bus.o
obj-$(CONFIG_PCIEPORTBUS) += pcieportdrv.o
--- /dev/null
+++ b/drivers/pci/pcie/portdrv_bus.c
@@ -0,0 +1,15 @@
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/pm.h>
+
+#include "portdrv.h"
+
+extern int pcie_port_bus_match(struct device *dev, struct device_driver *drv);
+
+struct bus_type pcie_port_bus_type = {
+ .name = "pci_express",
+ .match = pcie_port_bus_match,
+};
+EXPORT_SYMBOL_GPL(pcie_port_bus_type);