[PATCH 01/18] mtd: abstract last MTD partition parser argument
Artem Bityutskiy
dedekind1 at gmail.com
Wed Jun 22 05:16:29 EDT 2011
On Wed, 2011-06-22 at 13:05 +0400, Dmitry Eremin-Solenikov wrote:
> >> No, no and no. This data is passed to all parsers, so it should be valid
> >> for all
> >> of them. Either we have to add a way to specify, what exactly we have
> >> provided,
> >> or we have to leave data as separate struct fields.
> >
> > I do not see why we should waste memory - union will work well. This is
> > parser-specific object and the parser should know which fields belong to
> > him. And this object is not shared between parsers so they cannot screw
> > each other. Yes, this is not the most beautiful way to go, but it is
> > simple enough and suits this situation, I think.
>
> It _is_ shared between parsers. See: driver creates one mtd_part_parser_data
> instance, populates it and passes to parse_mtd_partitions (directly or
> indirectly).
> Then each parser uses the same object to get data. Consider what will happen
> when ixp4xx driver (which currently uses origin for RedBoot) will also gain
> OF support (as it's expected for all ARM-related things). It will set both
> origin (for RedBoot) and of_node (for ofpart).
Agree, please, ignore that part of my feedback.
--
Best Regards,
Artem Bityutskiy
More information about the linux-mtd
mailing list