Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252525
b: refs/heads/master
c: 5af3aa2
h: refs/heads/master
i:
  252523: 9beb527
v: v3
  • Loading branch information
Jamie Iles authored and David Woodhouse committed May 25, 2011
1 parent 6fd5cd8 commit 5787be9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 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: bc2ffddc46be60c12462f8ae60ed0eae2a62a17b
refs/heads/master: 5af3aa24cf552e1a8c2874697d1f30769d8abf5c
26 changes: 8 additions & 18 deletions trunk/drivers/mtd/maps/edb7312.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
#include <asm/io.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>

#ifdef CONFIG_MTD_PARTITIONS
#include <linux/mtd/partitions.h>
#endif

#define WINDOW_ADDR 0x00000000 /* physical properties of flash */
#define WINDOW_SIZE 0x01000000
Expand All @@ -40,8 +37,6 @@ struct map_info edb7312nor_map = {
.phys = WINDOW_ADDR,
};

#ifdef CONFIG_MTD_PARTITIONS

/*
* MTD partitioning stuff
*/
Expand All @@ -66,8 +61,6 @@ static struct mtd_partition static_partitions[3] =

static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };

#endif

static int mtd_parts_nb = 0;
static struct mtd_partition *mtd_parts = 0;

Expand Down Expand Up @@ -96,27 +89,24 @@ static int __init init_edb7312nor(void)
if (mymtd) {
mymtd->owner = THIS_MODULE;

#ifdef CONFIG_MTD_PARTITIONS
mtd_parts_nb = parse_mtd_partitions(mymtd, probes, &mtd_parts, MTDID);
if (mtd_parts_nb > 0)
part_type = "detected";
part_type = "detected";

if (mtd_parts_nb == 0)
{
if (mtd_parts_nb == 0) {
mtd_parts = static_partitions;
mtd_parts_nb = ARRAY_SIZE(static_partitions);
part_type = "static";
}
#endif
add_mtd_device(mymtd);

if (mtd_parts_nb == 0)
printk(KERN_NOTICE MSG_PREFIX "no partition info available\n");
printk(KERN_NOTICE MSG_PREFIX "no partition info available\n");
else
{
printk(KERN_NOTICE MSG_PREFIX
"using %s partition definition\n", part_type);
add_mtd_partitions(mymtd, mtd_parts, mtd_parts_nb);
}
/* Register the whole device first. */
mtd_device_register(mymtd, NULL, 0);
mtd_device_register(mymtd, mtd_parts, mtd_parts_nb);
return 0;
}

Expand All @@ -127,7 +117,7 @@ static int __init init_edb7312nor(void)
static void __exit cleanup_edb7312nor(void)
{
if (mymtd) {
del_mtd_device(mymtd);
mtd_device_unregister(mymtd);
map_destroy(mymtd);
}
if (edb7312nor_map.virt) {
Expand Down

0 comments on commit 5787be9

Please sign in to comment.