aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/h720x-flash.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/maps/h720x-flash.c')
-rw-r--r--drivers/mtd/maps/h720x-flash.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/drivers/mtd/maps/h720x-flash.c b/drivers/mtd/maps/h720x-flash.c
index 7f035860a36..49c14187fc6 100644
--- a/drivers/mtd/maps/h720x-flash.c
+++ b/drivers/mtd/maps/h720x-flash.c
@@ -58,18 +58,11 @@ static struct mtd_partition h720x_partitions[] = {
58 58
59#define NUM_PARTITIONS ARRAY_SIZE(h720x_partitions) 59#define NUM_PARTITIONS ARRAY_SIZE(h720x_partitions)
60 60
61static int nr_mtd_parts;
62static struct mtd_partition *mtd_parts;
63static const char *probes[] = { "cmdlinepart", NULL };
64
65/* 61/*
66 * Initialize FLASH support 62 * Initialize FLASH support
67 */ 63 */
68static int __init h720x_mtd_init(void) 64static int __init h720x_mtd_init(void)
69{ 65{
70
71 char *part_type = NULL;
72
73 h720x_map.virt = ioremap(h720x_map.phys, h720x_map.size); 66 h720x_map.virt = ioremap(h720x_map.phys, h720x_map.size);
74 67
75 if (!h720x_map.virt) { 68 if (!h720x_map.virt) {
@@ -92,16 +85,8 @@ static int __init h720x_mtd_init(void)
92 if (mymtd) { 85 if (mymtd) {
93 mymtd->owner = THIS_MODULE; 86 mymtd->owner = THIS_MODULE;
94 87
95 nr_mtd_parts = parse_mtd_partitions(mymtd, probes, &mtd_parts, 0); 88 mtd_device_parse_register(mymtd, NULL, 0,
96 if (nr_mtd_parts > 0) 89 h720x_partitions, NUM_PARTITIONS);
97 part_type = "command line";
98 if (nr_mtd_parts <= 0) {
99 mtd_parts = h720x_partitions;
100 nr_mtd_parts = NUM_PARTITIONS;
101 part_type = "builtin";
102 }
103 printk(KERN_INFO "Using %s partition table\n", part_type);
104 mtd_device_register(mymtd, mtd_parts, nr_mtd_parts);
105 return 0; 90 return 0;
106 } 91 }
107 92
@@ -120,10 +105,6 @@ static void __exit h720x_mtd_cleanup(void)
120 map_destroy(mymtd); 105 map_destroy(mymtd);
121 } 106 }
122 107
123 /* Free partition info, if commandline partition was used */
124 if (mtd_parts && (mtd_parts != h720x_partitions))
125 kfree (mtd_parts);
126
127 if (h720x_map.virt) { 108 if (h720x_map.virt) {
128 iounmap((void *)h720x_map.virt); 109 iounmap((void *)h720x_map.virt);
129 h720x_map.virt = 0; 110 h720x_map.virt = 0;