* Re: [PATCH 2/3] mtd: Factor out OF partition support from the NOR driver.
@ 2008-01-14 6:21 Stephen Rothwell
2008-01-15 23:43 ` Scott Wood
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2008-01-14 6:21 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev, dwmw2, linux-mtd
[-- Attachment #1: Type: text/plain, Size: 1305 bytes --]
Hi Scott,
[Corrected list address.]
On Fri, 11 Jan 2008 14:43:16 -0600 Scott Wood <scottwood@freescale.com> wrote:
>
> +++ b/drivers/mtd/ofpart.c
> +int __devinit of_mtd_parse_partitions(struct device *dev,
> + nr_parts = 0;
> + for (pp = node->child; pp; pp = pp->sibling)
for_each_child_of_node(node, pp)
> + nr_parts++;
> + for (pp = of_get_next_child(node, NULL), i = 0; pp;
> + pp = of_get_next_child(node, pp), i++) {
i = 0;
for_each_child_of_node(node, pp) {
> + const u32 *reg;
> + int len;
> +
> + reg = of_get_property(pp, "reg", &len);
> + if (!reg || (len != 2*sizeof(u32))) {
Spaces around '*'.
> + of_node_put(pp);
> + dev_err(dev, "Invalid 'reg' on %s\n", node->full_name);
> + kfree(*pparts);
> + *pparts = NULL;
> + return -EINVAL;
> + }
> + (*pparts)[i].offset = reg[0];
> + (*pparts)[i].size = reg[1];
> +
> + partname = of_get_property(pp, "label", &len);
> + if (!partname)
> + partname = of_get_property(pp, "name", &len);
> + (*pparts)[i].name = (char *)partname;
> +
> + if (of_get_property(pp, "read-only", &len))
> + (*pparts)[i].mask_flags = MTD_WRITEABLE;
i++;
> + }
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/3] mtd: Factor out OF partition support from the NOR driver.
2008-01-14 6:21 [PATCH 2/3] mtd: Factor out OF partition support from the NOR driver Stephen Rothwell
@ 2008-01-15 23:43 ` Scott Wood
2008-01-16 4:41 ` Stephen Rothwell
0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2008-01-15 23:43 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev, dwmw2, linux-mtd
Stephen Rothwell wrote:
>> + nr_parts = 0;
>> + for (pp = node->child; pp; pp = pp->sibling)
>
> for_each_child_of_node(node, pp)
"for_each_child_of_node" is only in Paul's tree, but this has to go via mtd.
Plus, I'm just moving the code; it's not new.
-Scott
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/3] mtd: Factor out OF partition support from the NOR driver.
2008-01-15 23:43 ` Scott Wood
@ 2008-01-16 4:41 ` Stephen Rothwell
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2008-01-16 4:41 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev, dwmw2, linux-mtd
[-- Attachment #1: Type: text/plain, Size: 507 bytes --]
On Tue, 15 Jan 2008 17:43:06 -0600 Scott Wood <scottwood@freescale.com> wrote:
>
> Stephen Rothwell wrote:
> >> + nr_parts = 0;
> >> + for (pp = node->child; pp; pp = pp->sibling)
> >
> > for_each_child_of_node(node, pp)
>
> "for_each_child_of_node" is only in Paul's tree, but this has to go via mtd.
>
> Plus, I'm just moving the code; it's not new.
OK, we can change it later.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-01-16 4:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-14 6:21 [PATCH 2/3] mtd: Factor out OF partition support from the NOR driver Stephen Rothwell
2008-01-15 23:43 ` Scott Wood
2008-01-16 4:41 ` Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox