[PATCH V5 0/2] mtd: simplify mtd_device_parse_register() code

Boris Brezillon boris.brezillon at bootlin.com
Sat Feb 17 00:38:12 PST 2018

On Tue, 16 Jan 2018 16:45:40 +0100
Rafał Miłecki <zajec5 at gmail.com> wrote:

> From: Rafał Miłecki <rafal at milecki.pl>
> Even though I have some experience with MTD subsystem every time I was
> starting working on it I had to do some quick research on the code flow.
> I think there is some place for cleanup and optimization that would
> simplify overall code and allow new developers to start working on it
> more easily.
> In these patches I meant to slightly simplify mtd_device_parse_register
> function. I think we could reduce amount of add/register/del functions
> and this is the first step for that.
> Ideally I think mtdcore.c shouldn't handle parsing but just use a single
> function from mtdpart.c.
> Patch 1/2 modifies code to make sure parsing code is not mixed with MTD
> master code. This should allow moving parsing parts to the mtdpart.c in
> the future.
> Patch 2/2 simplifies code and makes sure parsing is handled at 1 place
> only.
> Even though this cleanup isn't complete I think it already has some
> value and could be accepted (if there won't be objections) on its own.
> It's also quite small which should allow reviewing it easily.
> Rafał Miłecki (2):
>   mtd: move code adding master MTD out of mtd_add_device_partitions()
>   mtd: get rid of the mtd_add_device_partitions()

Applied (even if I keep thinking those 2 commits should have been
merged in a single one :P)



>  drivers/mtd/mtdcore.c | 58 ++++++++++++++++++---------------------------------
>  1 file changed, 20 insertions(+), 38 deletions(-)

Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering

More information about the linux-mtd mailing list