* [PATCH] mtd: fix broken name_to_dev_t() declaration
@ 2006-03-23 20:02 Herbert Poetzl
2006-03-23 23:46 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Herbert Poetzl @ 2006-03-23 20:02 UTC (permalink / raw)
To: Andrew Morton, Linux Kernel ML; +Cc: Micah Anderson, Daniel Hokka Zakrisson
Hi Andrew! Folks!
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
this patch was originally done by Micah Anderson.
best,
Herbert
Signed-off-by: Herbert Poetzl <herbert@13thfloor.at>
Acked-by: Micah Anderson <micah@riseup.net>
Acked-by: Daniel Hokka Zakrisson <daniel@hozac.com>
---
--- ./drivers/mtd/devices/blkmtd.c.orig 2006-01-03 17:29:35 +0100
+++ ./drivers/mtd/devices/blkmtd.c 2006-03-23 20:53:58 +0100
@@ -28,6 +28,7 @@
#include <linux/pagemap.h>
#include <linux/list.h>
#include <linux/init.h>
+#include <linux/mount.h>
#include <linux/mtd/mtd.h>
@@ -614,8 +615,6 @@ static struct mtd_erase_region_info *cal
}
-extern dev_t __init name_to_dev_t(const char *line);
-
static struct blkmtd_dev *add_device(char *devname, int readonly, int erase_size)
{
struct block_device *bdev;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: fix broken name_to_dev_t() declaration
2006-03-23 20:02 [PATCH] mtd: fix broken name_to_dev_t() declaration Herbert Poetzl
@ 2006-03-23 23:46 ` Andrew Morton
2006-03-23 23:51 ` Herbert Poetzl
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2006-03-23 23:46 UTC (permalink / raw)
To: Herbert Poetzl; +Cc: linux-kernel, micah, daniel
Herbert Poetzl <herbert@13thfloor.at> 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
OK..
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);
#else
mode = (readonly) ? FMODE_READ : FMODE_WRITE;
bdev = open_by_devnum(name_to_dev_t(devname), mode);
#endif
OK, I guess it still works at initcall-time. Still, the code is a bit,
err, innovative.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: fix broken name_to_dev_t() declaration
2006-03-23 23:46 ` Andrew Morton
@ 2006-03-23 23:51 ` Herbert Poetzl
0 siblings, 0 replies; 3+ messages in thread
From: Herbert Poetzl @ 2006-03-23 23:51 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, micah, daniel
On Thu, Mar 23, 2006 at 03:46:25PM -0800, Andrew Morton wrote:
> Herbert Poetzl <herbert@13thfloor.at> 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
>
> OK..
>
> 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);
> #else
> mode = (readonly) ? FMODE_READ : FMODE_WRITE;
> bdev = open_by_devnum(name_to_dev_t(devname), mode);
> #endif
>
> OK, I guess it still works at initcall-time. Still, the code is a bit,
> err, innovative.
ah, well, I was not judging the mtd code ...
just fixing an issue which popped up :)
best,
Herbert
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-03-23 23:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-23 20:02 [PATCH] mtd: fix broken name_to_dev_t() declaration Herbert Poetzl
2006-03-23 23:46 ` Andrew Morton
2006-03-23 23:51 ` Herbert Poetzl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome