Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274874
b: refs/heads/master
c: 2cd9ea5
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Eremin-Solenikov authored and Artem Bityutskiy committed Sep 11, 2011
1 parent 2f34080 commit 4a9ceb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 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: 9d7948c50055e74b693ce9e99a709b2e5bbc1942
refs/heads/master: 2cd9ea5256ecf2bc795d476598ac7f43f4b83a97
14 changes: 3 additions & 11 deletions trunk/drivers/mtd/nand/socrates_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ static int __devinit socrates_nand_probe(struct platform_device *ofdev)
int res;
struct mtd_partition *partitions = NULL;
int num_partitions = 0;
struct mtd_part_parser_data ppdata;

/* Allocate memory for the device structure (and zero it) */
host = kzalloc(sizeof(struct socrates_nand_host), GFP_KERNEL);
Expand All @@ -191,6 +192,7 @@ static int __devinit socrates_nand_probe(struct platform_device *ofdev)
mtd->name = "socrates_nand";
mtd->owner = THIS_MODULE;
mtd->dev.parent = &ofdev->dev;
ppdata.of_node = ofdev->dev.of_node;

/*should never be accessed directly */
nand_chip->IO_ADDR_R = (void *)0xdeadbeef;
Expand Down Expand Up @@ -223,22 +225,12 @@ static int __devinit socrates_nand_probe(struct platform_device *ofdev)
goto out;
}

num_partitions = parse_mtd_partitions(mtd, NULL, &partitions, 0);
num_partitions = parse_mtd_partitions(mtd, NULL, &partitions, &ppdata);
if (num_partitions < 0) {
res = num_partitions;
goto release;
}

if (num_partitions == 0) {
num_partitions = of_mtd_parse_partitions(&ofdev->dev,
ofdev->dev.of_node,
&partitions);
if (num_partitions < 0) {
res = num_partitions;
goto release;
}
}

res = mtd_device_register(mtd, partitions, num_partitions);
if (!res)
return res;
Expand Down

0 comments on commit 4a9ceb2

Please sign in to comment.