Re: [PATCH 050/104] physmap_of: separate parse_obsolete_partitions to separate parser

Dmitry Eremin-Solenikov
2011-06-06T08:09:52Z

On 06.06.2011 12:02, Artem Bityutskiy wrote:
> On Thu, 2011-06-02 at 18:51 +0400, Dmitry Eremin-Solenikov wrote:
>> Separate parse_obsolete_partitions() to external ofoldpart partitions parser.
>>
>> Signed-off-by: Dmitry Eremin-Solenikov<dbaryshkov@gmail.com>
>> ---
>> drivers/mtd/Kconfig | 10 +++++
>> drivers/mtd/Makefile | 1 +
>> drivers/mtd/maps/physmap_of.c | 53 +------------------------
>> drivers/mtd/ofoldpart.c | 89 +++++++++++++++++++++++++++++++++++++++++
>> 4 files changed, 101 insertions(+), 52 deletions(-)
>> create mode 100644 drivers/mtd/ofoldpart.c
>>
>> diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
>> index 4be8373..2aa8afb 100644
>> --- a/drivers/mtd/Kconfig
>> +++ b/drivers/mtd/Kconfig
>> @@ -144,6 +144,16 @@ config MTD_OF_PARTS
>> the partition map from the children of the flash node,
>> as described in Documentation/powerpc/booting-without-of.txt.
>>
>> +config MTD_OF_OLD_PARTS
>> + bool "Obsolete OF tree partition info"
>> + depends on OF
>> + help
>> + This provides a partition parsing function which derives
>> + the partition map from the the flash node, being an obsolete
>> + way to describe physmap_of partitioning info.
>> +
>> + If you aren't sure you need this, you can say N.
>
> I think this tiny piece of code does not deserve to be a separate
> module...

I'd really like to strip it out of physmap_of to simplify things.

It parses the mtd partitions, it's a separate functional part. I can
argue if it should be a module or just in-kernel part, if it should be
visible to users (or just autoselected by physmap_of), but I'd
definitely prefer to have this as a separate source file hooking into
generic mtd_parse subsystem.

--
With best wishes
Dmitry