Access entire device with mtdblock0

Adam Yergovich ayergo at jkmicro.com
Thu Feb 5 19:32:46 EST 2009


hartleys wrote:
> It appears this was originally thought about for mtd partitions.
> 
> In mdtpart.c, add_mtd_partitions() has a comment above it:
> 
> /*
>  * This function, given a master MTD object and a partition table,
> creates
>  * and registers slave MTD objects which are bound to the master
> according to
>  * the partition definitions.
>  * (Q: should we register the master MTD object as well?)
>  */
> 
> Maybe it was just never revisited?
> 

Could well be, some great sleuthing there.  I think the bigger question 
is "Does calling add_mtd_device() after the partitioning has been done 
work?"

I believe the answer to this is no, though some confirmation would be a 
good idea.

If that assumption is correct, I think it should be changed to either:

1) Call it before partitioning so it does add the device.

-or-

2) Change the function such that it works any time and thus the physmap 
call should work as originally written.

I'm not familiar enough with the intended function to know though.  The 
best i can say is that it seems to behave in this way, and it appears to 
me to have been intended to behave differently.

-Adam



More information about the linux-mtd mailing list