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

Rafał Miłecki zajec5 at gmail.com
Tue Jan 16 07:45:40 PST 2018


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()

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

-- 
2.11.0




More information about the linux-mtd mailing list