MTD devices at the wrong place

Eugene Surovegin ebs at innocent.com
Fri Nov 1 17:46:53 EST 2002


At 02:36 PM 11/1/2002, JЖrn Engel wrote:
>On Fri, 1 November 2002 00:28:22 -0800, Eugene Surovegin wrote:
> > At 11:58 PM 10/31/2002, you wrote:
> >
> > >##I guess it's ok to just create one device? or do I have to create them
> > >all? Or a directory structure under /dev/mtd0 and /dev/mtd1
> > >mknod /dev/mtd4 c 90 4
> >
> > /dev/mtd4 should be c 90 8
>
>Correction:
>/dev/mtd4 *should be* c 90 4, but for historical reasons, it is c 90 8.

Well, maybe I missing something, but mtdchar.c:

static int mtd_open(struct inode *inode, struct file *file)
{
         int minor = MINOR(inode->i_rdev);
         int devnum = minor >> 1;
         struct mtd_info *mtd;

....

Notice "minor >> 1".

As far as I understand, even numbers are used for rw access, odd - for ro.

Regards,

Eugene





More information about the linux-mtd mailing list