Skip to contentSkip to conversation

Changes to Config.in, mtdchar.c & mtdcore.c

PATCH Bjorn Eriksson 2 participants 2 messages Sep 22, 2000 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

I'm compiling on 2.2.14-16ish, as compatmac.h (and sysdep-2.2.h) defines
mod_init_t as 'static int __init' for kernel version < 2.3.0 I don't see how them init-funcs() can be called from mtdcore.c (when compiled as non-module). What am I missing?

* Anyways, some changes. Config.in need to extra "":

Index: mtd/kernel/Config.in
===================================================================
RCS file: /home/cvs/mtd/kernel/Config.in,v
retrieving revision 1.27

kernel/Config.in +1 -1
diff -u -r1.27 Config.in
@@ -6,7 +6,7 @@
 
 tristate 'Memory Technology Device (MTD) support' CONFIG_MTD
 
-if [ $CONFIG_MTD = "y" ]; then
+if [ "$CONFIG_MTD" = "y" ]; then
 comment 'Debugging'
    int 'Debugging verbosity (0 = quiet, 3 = noisy)'

CONFIG_MTD_DEBUG_VERBOSE 0
fi

* mtdchar.c tries to initialise 'file_operations.owner', I didn't find this in 2.3.99-pre6.

Index: mtd/kernel/mtdchar.c
===================================================================
RCS file: /home/cvs/mtd/kernel/mtdchar.c,v
retrieving revision 1.12

kernel/mtdchar.c +1 -1
diff -u -r1.12 mtdchar.c
@@ -376,7 +376,7 @@
 } /* memory_ioctl */
 
 static struct file_operations mtd_fops = {
-	owner:		THIS_MODULE,
+	/*Whats this? owner:		THIS_MODULE,*/
 	llseek:		mtd_lseek,     	/* lseek */
 	read:		mtd_read,	/* read */
 	write: 		mtd_write, 	/* write */

* And mtdcore.c could use a extern-declaration.

Index: mtd/kernel/mtdcore.c
===================================================================
RCS file: /home/cvs/mtd/kernel/mtdcore.c,v
retrieving revision 1.18

kernel/mtdcore.c +3 -0
diff -u -r1.18 mtdcore.c
@@ -67,6 +67,9 @@
 #ifdef CONFIG_MTD_SPIA_NAND
 extern int init_spia_nand(void);
 #endif
+#ifdef CONFIG_MTD_MTDRAM
+extern /*mod_init_t contains 'static'*/int init_mtdram(void);
+#endif
 #ifdef CONFIG_FTL
 extern int init_ftl(void);
 #endif

//Björnen.

To unsubscribe, send "unsubscribe mtd" to [email protected]

#1 lore raw

[...]

Quoted 6 lines

static struct file_operations mtd_fops = {

kernel/mtdchar.c +1 -1
-	owner:		THIS_MODULE,
+	/*Whats this? owner:		THIS_MODULE,*/
	llseek:		mtd_lseek,     	/* lseek */
	read:		mtd_read,	/* read */
	write: 		mtd_write, 	/* write */

Don't know, but all the devfs stuff used it so I put it in. It must be a 2.3ism and is probably worth putting in #ifdefs.

Signature · 7 lines
David Given
[email protected]




To unsubscribe, send "unsubscribe mtd" to [email protected]