Skip to contentSkip to conversation

MTD + kernel 2.2.18

PATCH David Vrabel 1 participant 1 message Dec 12, 2000 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi,

I'm trying out MTD with kernel 2.2.18 and there appear to be some problems with include/linux/mtd/compatmac.h. I wasn't entirely sure what was required so find a patch attached to review.

Also some of the init functions (eg in cfi_probe.c) are incorrect. Are they supposed to look like the ones in mtdcore.c?

David Vrabel

Index: compatmac.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/compatmac.h,v retrieving revision 1.10

compatmac.h +10 -3
diff -u -r1.10 compatmac.h
@@ -221,9 +221,12 @@
 #include <linux/init.h>
 #endif
 
-#if LINUX_VERSION_CODE < 0x20300
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
 #define init_MUTEX(x) do {*(x) = MUTEX;} while (0)
 #define init_MUTEX_LOCKED(x) do {*(x) = MUTEX_LOCKED;} while (0)
+#endif /* ERM? */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
 #define RQFUNC_ARG void
 #define blkdev_dequeue_request(req) do {CURRENT = req->next;} while (0)
 #else
@@ -244,11 +247,15 @@
 
 
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
 
 #define DECLARE_WAIT_QUEUE_HEAD(x) struct wait_queue *x = NULL
 #define init_waitqueue_head init_waitqueue
 
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
+
 static inline int try_inc_mod_count(struct module *mod)
 {
 #ifdef CONFIG_MODULES
@@ -329,7 +336,7 @@
 #include <linux/spinlock.h>
 #endif
 
-#if LINUX_VERSION_CODE < 0x20300
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
 #define set_current_state(state_value)                        \
         do { current->state = (state_value); } while (0)
 #endif