backports: backport class_find_device properly
authorJohannes Berg <johannes.berg@intel.com>
Mon, 15 Apr 2013 20:39:26 +0000 (22:39 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 15 Apr 2013 20:41:12 +0000 (22:41 +0200)
Instead of patching, make a macro that casts the const out
from the function pointer arguments to avoid the warning.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
backport/backport-include/linux/device.h
patches/collateral-evolutions/nfc/03-driver-core-constify-data/INFO [deleted file]
patches/collateral-evolutions/nfc/03-driver-core-constify-data/net_nfc_core.patch [deleted file]

index f37dbab731e2c59f35616996165e6121161f86d6..4c0adb778f9222a77de486e0c7dbef6947f2982e 100644 (file)
@@ -5,6 +5,20 @@
 
 #include <linux/version.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+/* backport
+ * commit 9f3b795a626ee79574595e06d1437fe0c7d51d29
+ * Author: Michał Mirosław <mirq-linux@rere.qmqm.pl>
+ * Date: Fri Feb 1 20:40:17 2013 +0100
+ *
+ * driver-core: constify data for class_find_device()
+ */
+typedef int (backport_device_find_function_t)(struct device *, void *);
+#define class_find_device(cls, start, idx, fun) \
+       class_find_device((cls), (start), (idx),\
+                         (backport_device_find_function_t *)(fun))
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
 #define dev_emerg(dev, format, arg...)          \
        dev_printk(KERN_EMERG , dev , format , ## arg)
diff --git a/patches/collateral-evolutions/nfc/03-driver-core-constify-data/INFO b/patches/collateral-evolutions/nfc/03-driver-core-constify-data/INFO
deleted file mode 100644 (file)
index 7926612..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-This backports:
-
-commit 9f3b795a626ee79574595e06d1437fe0c7d51d29
-Author: Michał Mirosław <mirq-linux@rere.qmqm.pl>
-Date: Fri Feb 1 20:40:17 2013 +0100
-
- driver-core: constify data for class_find_device()
diff --git a/patches/collateral-evolutions/nfc/03-driver-core-constify-data/net_nfc_core.patch b/patches/collateral-evolutions/nfc/03-driver-core-constify-data/net_nfc_core.patch
deleted file mode 100644 (file)
index d09365f..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/net/nfc/core.c
-+++ b/net/nfc/core.c
-@@ -732,7 +732,11 @@ struct class nfc_class = {
- };
- EXPORT_SYMBOL(nfc_class);
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
- static int match_idx(struct device *d, const void *data)
-+#else
-+static int match_idx(struct device *d, void *data)
-+#endif
- {
-       struct nfc_dev *dev = to_nfc_dev(d);
-       const unsigned int *idx = data;