Re: [PATCH/RFC] MTD: Striping layer core

Artem B. Bityutskiy
2006-03-31T09:37:33Z

Jörn Engel wrote:
> The current mess that makes up mtd->type and mtd->flags needs to be
> sanitized anyway. Instead of being MTD_NAND, MTD_NOR or MTD_STRIPED,
> it should tell the user _how_ to treat the device, not _what_ it is.
> Basically, whereever a user (jffs2 basically) has
> if (mtd->type == MTD_FOO)
> setup_bar;
> it should actually do
> if (mtd->flags == MTD_NEEDS_BAR)
> setup_bar;
>
> Quite likely there won't be many flags left after the cleanup is done.
> Most of them should simple be erase_size and write_size (page_size or
> ecc_size currently), not flags.

No, mtd->type has to tell you the type of the MTD device. Ideally, this
has to me the only flash-specific field in the mtd_info structure. And
if users want to do some flash specific things, they have to look at
mtd->type, realize what is the subsystem which handles this flash, and
start working with this subsystem. For striping, this is the striping
subsystem. I don't know what for mtd->flags, probably this hast to go at
all.

--
Best Regards,
Artem B. Bityutskiy,
St.-Petersburg, Russia.