Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84190
b: refs/heads/master
c: 4edaf56
h: refs/heads/master
v: v3
  • Loading branch information
Valentine Barshak authored and David Woodhouse committed Oct 30, 2007
1 parent 16c1927 commit 720b5fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a25b7fee537ab4dbc6eb301bd455ee8d01b707f6
refs/heads/master: 4edaf56e0f8a6f71e3361bf74e3dc835811761e6
13 changes: 7 additions & 6 deletions trunk/drivers/mtd/maps/physmap_of.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,13 @@ static int __devinit parse_partitions(struct of_flash *info,
* line, these take precedence over device tree information */
nr_parts = parse_mtd_partitions(info->mtd, part_probe_types,
&info->parts, 0);
if (nr_parts > 0) {
add_mtd_partitions(info->mtd, info->parts, nr_parts);
return 0;
}
if (nr_parts > 0)
return nr_parts;

/* First count the subnodes */
nr_parts = 0;
for (pp = dp->child; pp; pp = pp->sibling)
for (pp = of_get_next_child(dp, NULL); pp;
pp = of_get_next_child(dp, pp))
nr_parts++;

if (nr_parts == 0)
Expand All @@ -112,12 +111,14 @@ static int __devinit parse_partitions(struct of_flash *info,
if (!info->parts)
return -ENOMEM;

for (pp = dp->child, i = 0; pp; pp = pp->sibling, i++) {
for (pp = of_get_next_child(dp, NULL), i = 0; pp;
pp = of_get_next_child(dp, pp), i++) {
const u32 *reg;
int len;

reg = of_get_property(pp, "reg", &len);
if (!reg || (len != 2*sizeof(u32))) {
of_node_put(pp);
dev_err(&dev->dev, "Invalid 'reg' on %s\n",
dp->full_name);
kfree(info->parts);
Expand Down

0 comments on commit 720b5fb

Please sign in to comment.