[PATCH 02/62] mtd: introduce mtd_device_(un)register()
Jamie Iles
jamie at jamieiles.com
Mon May 23 19:06:44 EDT 2011
On Mon, May 23, 2011 at 06:55:49PM -0400, Mike Frysinger wrote:
> On Mon, May 23, 2011 at 05:22, Jamie Iles wrote:
> > To prepare for the removal of add_mtd_device and add_mtd_partitions(),
> > introduce mtd_device_register(). This will create partitions if they
> > are supplied or register the whole device if there are no partitions.
> >
> > Once all drivers are converted to use mtd_device_register(),
> > add_mtd_device() and add_mtd_partitions() will be made internal only.
>
> i vaguely recall attempting to submit new functions like this a while
> ago, but ultimately it was rejected due to the different behavior mtd
> drivers had wrt partitions and whole devices
I think these cases can still be covered - mtd_device_register() can be
called twice - once with partitions and once without so it's just like
calling add_mtd_device() then add_mtd_partitions(). The unregistering
code deletes all registered partitions then only the master if it has
been registered.
I don't believe these patches should have changed the behaviour of any
of the drivers (other than it's now not possible to select whether the
device is partitioned or not by a Kconfig option), but that can be done
at runtime through command line partitioning perhaps.
Jamie
More information about the linux-mtd
mailing list