backports: do not depend on PCI functions when PCI is disabled in the kernel
authorHauke Mehrtens <hauke@hauke-m.de>
Sat, 24 Aug 2013 14:28:59 +0000 (16:28 +0200)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Tue, 27 Aug 2013 19:02:30 +0000 (12:02 -0700)
This should prevent some compile errors when backports is used with a
kernel without PCI support.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
backport/compat/compat-2.6.27.c
backport/compat/compat-2.6.28.c
backport/compat/compat-3.7.c

index cda98e8f1cfec49f88b0c5810460a69662cbc6b8..7235c878993b638454288f5f3335d3150acfdb5d 100644 (file)
@@ -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))
 /**
index 2ff6b1eea16544bfe50fb4c23883dc97ea7d841d..e38004f1776e5705f8e027a288c26eb40d86642f 100644 (file)
@@ -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
 
index 8f5a56cfffba761bcb40f99f6fc3e85ebf414ea4..675cf293d17a579a364afe65f67dd7220ad09b68 100644 (file)
@@ -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