[PATCH,RFC] [MTD] replace MTD_NORFLASH with MTD_GENERIC_TYPE

Jörn Engel joern at wohnheim.fh-wedel.de
Tue May 30 11:59:22 EDT 2006


On Tue, 30 May 2006 16:55:02 +0100, David Woodhouse wrote:
> On Tue, 2006-05-30 at 17:50 +0200, Jörn Engel wrote:
> > Until recently, we had four different variants of jffs2 wbuf code,
> > depending on the flash type.  I fail to see the difference between
> > those four and have already merged two of them.  Unless I am missing
> > something important, the other three can also be combined into one.
> > 
> > But doing so would result in something like
> >         if ((mtd->type == MTD_NAND) || (mtd->type == MTD_SIBLEY) ||
> >                         (mtd->type == MTD_ECCNOR) ||
> >                         (mtd->type == MTD_DATAFLASH))
> 
> That's why we _also_ have the flags, and why we abstract that still
> further in application-specific code, like jffs2_can_mark_obsolete()
> 
> But you seem to want to kill _both_ the type _and_ the flag -- you say
> that you want the MTD_KF_NOR_WBUF_FLASH flag to go away. So explain --
> what do you want to do instead?

	if (mtd->writesize > 1)

If the device does not allow writes to happen in arbitrary hunks, we
need wbuf.  That's all.

The currently three different variants of initializing wbuf need to be
converged into one generic method.  That won't happen just now, so I
introduced a temporary flag for one variant of initialization code.
The real gain comes with merging the three remaining variants,
obviously.

Jörn

-- 
It's just what we asked for, but not what we want!
-- anonymous




More information about the linux-mtd mailing list