[PATCH 00/28] introduce wrappers for mtd interfaces

Mike Dunn mikedunn at newsguy.com
Sun Dec 25 09:50:36 EST 2011


On 12/23/2011 10:10 AM, Artem Bityutskiy wrote:
> Hi,
>
> this patch-series introduce a bunch of wrappers for mtd interfaces, e.g.:
> * mtd_read() for mtd->read()
> * mtd_write() for mtd->write()
> * mtd_is_locked() form mtd->is_locked()
>
> and so forth for all interfaces found in 'struct mtd_info'.
>
> The motivation is to help Mike Dunn to improve MTD bit-flips handling.


And a merry Christmas to you too, Artem :)

Thanks much.  I'll follow up with my patches as soon as my head clears from the
egg nog.


> This patch-set only substitutes 'mtd->func()' with 'mtd_func()', I used spatch
> to do this. But we'd need to do some more work:
>  1 Find places like
> 	if (mtd->block_isbad)
> 		mtd_block_isbad(...)
>    and nicify them (possibly move the "if" check to the wrapper)
>  2 Rename all the function pointers in 'struct mtd_info' in order to
>    make sure every driver has switched to the wrappers.
>  3 Move the common input parameters checking to the wrappers


I guess the plan is to eventually move the wrappers out of the header file and
no longer declare them inline?

Thanks again,
Mike




More information about the linux-mtd mailing list