From: Hauke Mehrtens Date: Sat, 24 Aug 2013 14:28:59 +0000 (+0200) Subject: backports: do not depend on PCI functions when PCI is disabled in the kernel X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=168beb7a3dad933d29f8e0dabd37db8cf189a4c7;p=openwrt%2Fstaging%2Fblogic.git backports: do not depend on PCI functions when PCI is disabled in the kernel This should prevent some compile errors when backports is used with a kernel without PCI support. Signed-off-by: Hauke Mehrtens Signed-off-by: Luis R. Rodriguez --- diff --git a/backport/compat/compat-2.6.27.c b/backport/compat/compat-2.6.27.c index cda98e8f1cfe..7235c878993b 100644 --- a/backport/compat/compat-2.6.27.c +++ b/backport/compat/compat-2.6.27.c @@ -29,6 +29,7 @@ * we have to call the PCI routines directly. */ +#ifdef CONFIG_PCI /** * pci_pme_capable - check the capability of PCI device to generate PME# * @dev: PCI device to handle. @@ -65,6 +66,7 @@ bool pci_pme_capable(struct pci_dev *dev, pci_power_t state) return !!(pme_support & (1 << state)); } EXPORT_SYMBOL_GPL(pci_pme_capable); +#endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) /** diff --git a/backport/compat/compat-2.6.28.c b/backport/compat/compat-2.6.28.c index 2ff6b1eea165..e38004f1776e 100644 --- a/backport/compat/compat-2.6.28.c +++ b/backport/compat/compat-2.6.28.c @@ -239,6 +239,7 @@ EXPORT_SYMBOL_GPL(usb_anchor_empty); #endif /* CONFIG_USB */ #endif +#ifdef CONFIG_PCI void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar) { /* @@ -252,6 +253,7 @@ void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar) pci_resource_len(pdev, bar)); } EXPORT_SYMBOL_GPL(pci_ioremap_bar); +#endif static unsigned long round_jiffies_common(unsigned long j, int cpu, bool force_up) @@ -442,6 +444,7 @@ int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, } EXPORT_SYMBOL_GPL(n_tty_ioctl_helper); +#ifdef CONFIG_PCI /** * pci_wake_from_d3 - enable/disable device to wake up from D3_hot or D3_cold * @dev: PCI device to prepare @@ -463,4 +466,5 @@ int pci_wake_from_d3(struct pci_dev *dev, bool enable) pci_enable_wake(dev, PCI_D3hot, enable); } EXPORT_SYMBOL_GPL(pci_wake_from_d3); +#endif diff --git a/backport/compat/compat-3.7.c b/backport/compat/compat-3.7.c index 8f5a56cfffba..675cf293d17a 100644 --- a/backport/compat/compat-3.7.c +++ b/backport/compat/compat-3.7.c @@ -22,6 +22,7 @@ bool mod_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork, } EXPORT_SYMBOL_GPL(mod_delayed_work); +#ifdef CONFIG_PCI /* * Kernels >= 3.7 get their PCI-E Capabilities Register cached * via the pci_dev->pcie_flags_reg so for older kernels we have @@ -251,6 +252,7 @@ int pcie_capability_clear_and_set_dword(struct pci_dev *dev, int pos, return ret; } EXPORT_SYMBOL_GPL(pcie_capability_clear_and_set_dword); +#endif #ifdef KERNEL_HAS_OF_SUPPORT #ifdef CONFIG_OF