aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/ts7250.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand/ts7250.c')
-rw-r--r--drivers/mtd/nand/ts7250.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/mtd/nand/ts7250.c b/drivers/mtd/nand/ts7250.c
index 643633d91a8b..d2b7d57ace42 100644
--- a/drivers/mtd/nand/ts7250.c
+++ b/drivers/mtd/nand/ts7250.c
@@ -88,7 +88,7 @@ static void ts7250_hwcontrol(struct mtd_info *mtd, int cmd)
88{ 88{
89 unsigned long ctrl = TS72XX_NAND_CONTROL_VIRT_BASE; 89 unsigned long ctrl = TS72XX_NAND_CONTROL_VIRT_BASE;
90 90
91 switch(cmd) { 91 switch (cmd) {
92 case NAND_CTL_SETCLE: 92 case NAND_CTL_SETCLE:
93 __raw_writeb(__raw_readb(ctrl) | 0x2, ctrl); 93 __raw_writeb(__raw_readb(ctrl) | 0x2, ctrl);
94 break; 94 break;
@@ -132,8 +132,7 @@ static int __init ts7250_init(void)
132 return -ENXIO; 132 return -ENXIO;
133 133
134 /* Allocate memory for MTD device structure and private data */ 134 /* Allocate memory for MTD device structure and private data */
135 ts7250_mtd = kmalloc(sizeof(struct mtd_info) + 135 ts7250_mtd = kmalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip), GFP_KERNEL);
136 sizeof(struct nand_chip), GFP_KERNEL);
137 if (!ts7250_mtd) { 136 if (!ts7250_mtd) {
138 printk("Unable to allocate TS7250 NAND MTD device structure.\n"); 137 printk("Unable to allocate TS7250 NAND MTD device structure.\n");
139 return -ENOMEM; 138 return -ENOMEM;
@@ -163,11 +162,9 @@ static int __init ts7250_init(void)
163 kfree(ts7250_mtd); 162 kfree(ts7250_mtd);
164 return -ENXIO; 163 return -ENXIO;
165 } 164 }
166
167#ifdef CONFIG_MTD_PARTITIONS 165#ifdef CONFIG_MTD_PARTITIONS
168 ts7250_mtd->name = "ts7250-nand"; 166 ts7250_mtd->name = "ts7250-nand";
169 mtd_parts_nb = parse_mtd_partitions(ts7250_mtd, part_probes, 167 mtd_parts_nb = parse_mtd_partitions(ts7250_mtd, part_probes, &mtd_parts, 0);
170 &mtd_parts, 0);
171 if (mtd_parts_nb > 0) 168 if (mtd_parts_nb > 0)
172 part_type = "command line"; 169 part_type = "command line";
173 else 170 else
@@ -188,6 +185,7 @@ static int __init ts7250_init(void)
188 /* Return happy */ 185 /* Return happy */
189 return 0; 186 return 0;
190} 187}
188
191module_init(ts7250_init); 189module_init(ts7250_init);
192 190
193/* 191/*
@@ -201,6 +199,7 @@ static void __exit ts7250_cleanup(void)
201 /* Free the MTD device structure */ 199 /* Free the MTD device structure */
202 kfree(ts7250_mtd); 200 kfree(ts7250_mtd);
203} 201}
202
204module_exit(ts7250_cleanup); 203module_exit(ts7250_cleanup);
205 204
206MODULE_LICENSE("GPL"); 205MODULE_LICENSE("GPL");