To backport
b718989d correctly which added pci_enable_device_mem()
the routine pcibios_enable_device() is required but we don't
have access to it on modules as its an architecture specific
routine that is not exported and as such only core kernel code
has access to it. We implement a sloppy work around for
backporting this.
mcgrof@tux ~/compat (git::master)$ ckmake
Trying kernel 3.4.0-030400rc1-generic [OK]
Trying kernel 3.3.0-030300rc2-generic [OK]
Trying kernel 3.2.2-030202-generic [OK]
Trying kernel 3.1.10-030110-generic [OK]
Trying kernel 3.0.18-030018-generic [OK]
Trying kernel 2.6.39-
02063904-generic [OK]
Trying kernel 2.6.38-
02063808-generic [OK]
Trying kernel 2.6.37-
02063706-generic [OK]
Trying kernel 2.6.36-
02063604-generic [OK]
Trying kernel 2.6.35-
02063512-generic [OK]
Trying kernel 2.6.34-
02063410-generic [OK]
Trying kernel 2.6.33-
02063305-generic [OK]
Trying kernel 2.6.32-
02063255-generic [OK]
Trying kernel 2.6.31-
02063113-generic [OK]
Trying kernel 2.6.30-
02063010-generic [OK]
Trying kernel 2.6.29-
02062906-generic [OK]
Trying kernel 2.6.28-
02062810-generic [OK]
Trying kernel 2.6.27-020627-generic [OK]
Trying kernel 2.6.26-020626-generic [OK]
Trying kernel 2.6.25-020625-generic [OK]
Trying kernel 2.6.24-020624-generic [OK]
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
/*
- * Copyright 2007-2010 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
+ * Copyright 2007-2012 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
*/
#include <linux/miscdevice.h>
+#include <linux/pci.h>
+
+/*
+ * To backport b718989d correctly pcibios_enable_device()
+ * is required but we don't have access to it on modules
+ * as its an architecture specific routine that is not
+ * exported and as such only core kernel code has access
+ * to it. We implement a sloppy work around for backporting
+ * this.
+ */
+int pci_enable_device_mem(struct pci_dev *dev)
+{
+ int bars = pci_select_bars(dev, IORESOURCE_MEM);
+
+ return pci_enable_device_bars(dev, bars);
+}
+EXPORT_SYMBOL_GPL(pci_enable_device_mem);
/**
* The following things are out of ./lib/vsprintf.c
#include <linux/in.h>
#include <linux/errno.h>
#include <linux/init.h>
+#include <linux/pci.h>
+
+/* Backports b718989da7 */
+int __must_check pci_enable_device_mem(struct pci_dev *dev);
/*
* Backports 312b1485fb509c9bc32eda28ad29537896658cb8