Skip to contentSkip to conversation

in CVS: drivers/mtd/mtdchar.c:65: called object is not a function

PATCH In review Miernik 2 participants 6 messages Nov 4, 2003 – Nov 7, 2003 Memory technology devices (MTD)

lore
Share & tools
lore

Miernik

author
#0 lore raw

I tried patching 2.6.0-test9 kernel with CVS code fetched today at ~ 22:30 CET, and I ended with this:

CC [M] drivers/mtd/mtdcore.o
CC [M] drivers/mtd/mtdchar.o
drivers/mtd/mtdchar.c: In function `mtd_open':
drivers/mtd/mtdchar.c:65: called object is not a function make[3]: *** [drivers/mtd/mtdchar.o] Error 1
make[2]: *** [drivers/mtd] Error 2
make[1]: *** [drivers] Error 2
make[1]: Leaving directory `/usr/src/kernel-source-2.6.0-test9'
make: *** [stamp-build] Error 2

Signature · 4 lines
    Miernik         ________________________ jabber:[email protected]
___________________/__ tel: +48608233394 __/      mailto:[email protected]
Support impeaching the war criminalist George W. Bush
http://www.votetoimpeach.org/
author
#1 lore raw
Quoted 2 lines · Miernik

I tried patching 2.6.0-test9 kernel with CVS code fetched today at ~ 22:30 CET, and I ended with this:

After I took the original mtdchar.c from kernel-source, it compiled OK, but I got another problem:

  CC [M]  drivers/mtd/mtdchar.o
  CC [M]  drivers/mtd/mtdblock.o
  CC [M]  drivers/mtd/mtd_blkdevs.o

In file included from drivers/mtd/mtd_blkdevs.c:18:
include/linux/blk.h:1: warning: #warning this file is obsolete, please use <linux/blkdev.h> instead drivers/mtd/mtd_blkdevs.c: In function `register_mtd_blktrans':
drivers/mtd/mtd_blkdevs.c:396: warning: passing arg 1 of blk_init_queue' from incompatible pointer type drivers/mtd/mtd_blkdevs.c:396: warning: passing arg 2 of blk_init_queue' from incompatible pointer type drivers/mtd/mtd_blkdevs.c:396: too many arguments to function `blk_init_queue'
make[3]: *** [drivers/mtd/mtd_blkdevs.o] Error 1
make[2]: *** [drivers/mtd] Error 2
make[1]: *** [drivers] Error 2
make[1]: Leaving directory `/usr/src/kernel-source-2.6.0-test9'
make: *** [stamp-build] Error 2
miernik@debina:/usr/src/kernel-source-2.6.0-test9$

Signature · 4 lines
    Miernik         ________________________ jabber:[email protected]
___________________/__ tel: +48608233394 __/      mailto:[email protected]
Learn about crime done by George W. Bush in Iraq, and related to 9/11
http://www.whatreallyhappened.com/
author
#2 lore raw
In reply to Miernik
Quoted 2 lines · Miernik

I tried patching 2.6.0-test9 kernel with CVS code fetched today at ~ 22:30 CET, and I ended with this:

And another problem:

CC [M] drivers/mtd/chips/sharp.o
drivers/mtd/chips/sharp.c: In function `sharp_do_wait_for_ready':
drivers/mtd/chips/sharp.c:447: warning: comparison of distinct pointer types lacks a cast
CC [M] drivers/mtd/maps/map_funcs.o
CC [M] drivers/mtd/maps/pcmciamtd.o
drivers/mtd/maps/pcmciamtd.c: In function `pcmciamtd_event':
drivers/mtd/maps/pcmciamtd.c:724: structure has no member named release' drivers/mtd/maps/pcmciamtd.c: In function pcmciamtd_detach':
drivers/mtd/maps/pcmciamtd.c:765: structure has no member named release' drivers/mtd/maps/pcmciamtd.c: In function pcmciamtd_attach':
drivers/mtd/maps/pcmciamtd.c:804: structure has no member named release' drivers/mtd/maps/pcmciamtd.c:805: structure has no member named release' drivers/mtd/maps/pcmciamtd.c:806: structure has no member named `release' make[4]: *** [drivers/mtd/maps/pcmciamtd.o] Error 1
make[3]: *** [drivers/mtd/maps] Error 2
make[2]: *** [drivers/mtd] Error 2
make[1]: *** [drivers] Error 2
make[1]: Leaving directory `/usr/src/kernel-source-2.6.0-test9'
make: *** [stamp-build] Error 2 miernik@debina:/usr/src/kernel-source-2.6.0-test9$

Signature · 4 lines
    Miernik         ________________________ jabber:[email protected]
___________________/__ tel: +48608233394 __/      mailto:[email protected]
Sing a declaration against US invasion in Iraq:
http://www.moveon.org/declaration/
#3 lore raw
Quoted 5 lines · Miernik
Quoted 2 lines · Miernik

I tried patching 2.6.0-test9 kernel with CVS code fetched today at ~ 22:30 CET, and I ended with this:

And another problem:

I haven't been tracking changes in Linus' 2.6 tree recently. Some stuff changed in Linus' tree since I last looked. Take a diff between what's actually in 2.6, and the corresponding $Id$ tag from CVS... those are the changes which need to be merged into the CVS tree.

Signature · 1 line
dwmw2
author
#4 lore raw

PATCH 1/1 gets the current CVS MTD code to compile with 2.6.0-test9

In reply to Miernik
Quoted 4 lines · David Woodhouse

I haven't been tracking changes in Linus' 2.6 tree recently. Some stuff changed in Linus' tree since I last looked. Take a diff between what's actually in 2.6, and the corresponding $Id$ tag from CVS... those are the changes which need to be merged into the CVS tree.

Here is a patch which makes the smallest set of changes needed to get current CVS code to compile with kernel 2.6.0-test9

I also place it on the web:
http://www.miernik.ctnet.pl/mtd/mtd-miernik-20031107.diff

Authors of the three changed files: please take a look what I did with this, in case I'm destroying something you've meant to do. If it's OK, please merge it into CVS.

Signature · 4 lines
    Miernik         ________________________ jabber:[email protected]
___________________/__ tel: +48608233394 __/      mailto:[email protected]
Bush "won" 2000 elections with 537 Florida votes. More people where illegaly 
prevented to vote:  http://www.observer.co.uk/Print/0,3858,4103063,00.html 
drivers/mtd/maps/pcmciamtd.c +1 -7
diff -Nur mtd.orig/drivers/mtd/maps/pcmciamtd.c mtd/drivers/mtd/maps/pcmciamtd.c
@@ -721,7 +721,7 @@
 				del_mtd_device(dev->mtd_info);
 				info("mtd%d: Removed", dev->mtd_info->index);
 			}
-			mod_timer(&link->release, jiffies + HZ/20);
+			pcmciamtd_release((u_long)link);
 		}
 		break;
 	case CS_EVENT_CARD_INSERTION:
@@ -762,8 +762,6 @@
 {
 	DEBUG(3, "link=0x%p", link);
 
-	del_timer(&link->release);
-
 	if(link->state & DEV_CONFIG) {
 		pcmciamtd_release((u_long)link);
 	}
@@ -801,10 +799,6 @@
 	link = &dev->link;
 	link->priv = dev;
 
-	init_timer(&link->release);
-	link->release.function = &pcmciamtd_release;
-	link->release.data = (u_long)link;
-
 	link->conf.Attributes = 0;
 	link->conf.IntType = INT_MEMORY;
 
drivers/mtd/mtd_blkdevs.c +14 -8
diff -Nur mtd.orig/drivers/mtd/mtd_blkdevs.c mtd/drivers/mtd/mtd_blkdevs.c
@@ -33,7 +33,7 @@
 	struct completion thread_dead;
 	int exiting;
 	wait_queue_head_t thread_wq;
-	struct request_queue rq;
+	struct request_queue *rq;
 	spinlock_t queue_lock;
 };
 
@@ -79,7 +79,7 @@
 static int mtd_blktrans_thread(void *arg)
 {
 	struct mtd_blktrans_ops *tr = arg;
-	struct request_queue *rq = &tr->blkcore_priv->rq;
+	struct request_queue *rq = tr->blkcore_priv->rq;
 
 	/* we might get involved when memory gets low, so use PF_MEMALLOC */
 	current->flags |= PF_MEMALLOC;
@@ -301,7 +301,7 @@
 
 	gd->private_data = new;
 	new->blkcore_priv = gd;
-	gd->queue = &tr->blkcore_priv->rq;
+	gd->queue = tr->blkcore_priv->rq;
 
 	if (new->readonly)
 		set_disk_ro(gd, 1);
@@ -392,14 +392,20 @@
 	init_completion(&tr->blkcore_priv->thread_dead);
 	init_waitqueue_head(&tr->blkcore_priv->thread_wq);
 
-	blk_init_queue(&tr->blkcore_priv->rq, mtd_blktrans_request, 
-		       &tr->blkcore_priv->queue_lock);
-	tr->blkcore_priv->rq.queuedata = tr;
+	tr->blkcore_priv->rq = blk_init_queue(mtd_blktrans_request, &tr->blkcore_priv->queue_lock);
+	if (!tr->blkcore_priv->rq) {
+		unregister_blkdev(tr->major, tr->name);
+		kfree(tr->blkcore_priv);
+		up(&mtd_table_mutex);
+		return -ENOMEM;
+	}
+
+	tr->blkcore_priv->rq->queuedata = tr;
 
 	ret = kernel_thread(mtd_blktrans_thread, tr, 
 			    CLONE_FS|CLONE_FILES|CLONE_SIGHAND);
 	if (ret < 0) {
-		blk_cleanup_queue(&tr->blkcore_priv->rq);
+		blk_cleanup_queue(tr->blkcore_priv->rq);
 		unregister_blkdev(tr->major, tr->name);
 		kfree(tr->blkcore_priv);
 		up(&mtd_table_mutex);
@@ -441,7 +447,7 @@
 	}
 
 	devfs_remove(tr->name);
-	blk_cleanup_queue(&tr->blkcore_priv->rq);
+	blk_cleanup_queue(tr->blkcore_priv->rq);
 	unregister_blkdev(tr->major, tr->name);
 
 	up(&mtd_table_mutex);
drivers/mtd/mtdchar.c +1 -1
diff -Nur mtd.orig/drivers/mtd/mtdchar.c mtd/drivers/mtd/mtdchar.c
@@ -62,7 +62,7 @@
 
 static int mtd_open(struct inode *inode, struct file *file)
 {
-	int minor = minor(inode->i_rdev);
+	int minor = iminor(inode);
 	int devnum = minor >> 1;
 	struct mtd_info *mtd;
 
#5 lore raw

Re: [PATCH] gets the current CVS MTD code to compile with 2.6.0-test9

Quoted 3 lines · Miernik

Authors of the three changed files: please take a look what I did with this, in case I'm destroying something you've meant to do. If it's OK, please merge it into CVS.

Looks sane; I've committed all but pcmciamtd.c which you said on IRC you were still working on.

Signature · 1 line
dwmw2