Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274837
b: refs/heads/master
c: e062e2f
h: refs/heads/master
i:
  274835: f97bea9
v: v3
  • Loading branch information
Dmitry Eremin-Solenikov authored and Artem Bityutskiy committed Sep 11, 2011
1 parent 1740b14 commit 761c7e2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 21 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: 7029eef8ba6ebf96c18c4b3138c35fcd1342a80a
refs/heads/master: e062e2f52fed5bcf65b3228e991771a4a6030d85
33 changes: 13 additions & 20 deletions trunk/drivers/mtd/maps/wr_sbc82xx_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <asm/immap_cpm2.h>

static struct mtd_info *sbcmtd[3];
static struct mtd_partition *sbcmtd_parts[3];

struct map_info sbc82xx_flash_map[3] = {
{.name = "Boot flash"},
Expand Down Expand Up @@ -101,6 +100,7 @@ static int __init init_sbc82xx_flash(void)
for (i=0; i<3; i++) {
int8_t flashcs[3] = { 0, 6, 1 };
int nr_parts;
struct mtd_partition *defparts;

printk(KERN_NOTICE "PowerQUICC II %s (%ld MiB on CS%d",
sbc82xx_flash_map[i].name,
Expand All @@ -113,7 +113,8 @@ static int __init init_sbc82xx_flash(void)
}
printk(" at %08lx)\n", sbc82xx_flash_map[i].phys);

sbc82xx_flash_map[i].virt = ioremap(sbc82xx_flash_map[i].phys, sbc82xx_flash_map[i].size);
sbc82xx_flash_map[i].virt = ioremap(sbc82xx_flash_map[i].phys,
sbc82xx_flash_map[i].size);

if (!sbc82xx_flash_map[i].virt) {
printk("Failed to ioremap\n");
Expand All @@ -129,24 +130,20 @@ static int __init init_sbc82xx_flash(void)

sbcmtd[i]->owner = THIS_MODULE;

nr_parts = parse_mtd_partitions(sbcmtd[i], part_probes,
&sbcmtd_parts[i], 0);
if (nr_parts > 0) {
mtd_device_register(sbcmtd[i], sbcmtd_parts[i],
nr_parts);
continue;
}

/* No partitioning detected. Use default */
if (i == 2) {
mtd_device_register(sbcmtd[i], NULL, 0);
defparts = NULL;
nr_parts = 0;
} else if (i == bigflash) {
mtd_device_register(sbcmtd[i], bigflash_parts,
ARRAY_SIZE(bigflash_parts));
defparts = bigflash_parts;
nr_parts = ARRAY_SIZE(bigflash_parts);
} else {
mtd_device_register(sbcmtd[i], smallflash_parts,
ARRAY_SIZE(smallflash_parts));
defparts = smallflash_parts;
nr_parts = ARRAY_SIZE(smallflash_parts);
}

mtd_device_parse_register(sbcmtd[i], part_probes, 0,
defparts, nr_parts);
}
return 0;
}
Expand All @@ -159,12 +156,8 @@ static void __exit cleanup_sbc82xx_flash(void)
if (!sbcmtd[i])
continue;

if (i<2 || sbcmtd_parts[i])
mtd_device_unregister(sbcmtd[i]);
else
mtd_device_unregister(sbcmtd[i]);
mtd_device_unregister(sbcmtd[i]);

kfree(sbcmtd_parts[i]);
map_destroy(sbcmtd[i]);

iounmap((void *)sbc82xx_flash_map[i].virt);
Expand Down

0 comments on commit 761c7e2

Please sign in to comment.