Re: [PATCH] mtd: fix broken name_to_dev_t() declaration

From: Andrew Morton
Date: Thu Mar 23 2006 - 18:41:32 EST

Herbert Poetzl <herbert@xxxxxxxxxxxx> wrote:
> drivers/mtd/devices/blkmtd.c uses a local declaration
> of name_to_dev_t() which is inconsistant with the real
> one. the following patch fixes this by removing the
> local declaration and including mount.h instead


Does that name_to_dev_t() call actually work? In my experience,
name_to_dev_t() just doesn't work if called at times other than during
early boot.

#ifdef MODULE
mode = (readonly) ? O_RDONLY : O_RDWR;
bdev = open_bdev_excl(devname, mode, NULL);
mode = (readonly) ? FMODE_READ : FMODE_WRITE;
bdev = open_by_devnum(name_to_dev_t(devname), mode);

OK, I guess it still works at initcall-time. Still, the code is a bit,
err, innovative.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at