aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/h1910.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-05-13 13:07:53 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-05-13 13:07:53 -0400
commite0c7d7675331140e5186d2d1a0efce1d3877d379 (patch)
tree45247eb5029382c64392aa641e8b0e5506ed152f /drivers/mtd/nand/h1910.c
parent6943f8af7d6583be57d67bba8b2644371f6a10ca (diff)
[MTD NAND] Indent all of drivers/mtd/nand/*.c.
It was just too painful to deal with. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/nand/h1910.c')
-rw-r--r--drivers/mtd/nand/h1910.c57
1 files changed, 27 insertions, 30 deletions
diff --git a/drivers/mtd/nand/h1910.c b/drivers/mtd/nand/h1910.c
index f68f7a99a630..efa53a9adf23 100644
--- a/drivers/mtd/nand/h1910.c
+++ b/drivers/mtd/nand/h1910.c
@@ -26,7 +26,7 @@
26#include <linux/mtd/nand.h> 26#include <linux/mtd/nand.h>
27#include <linux/mtd/partitions.h> 27#include <linux/mtd/partitions.h>
28#include <asm/io.h> 28#include <asm/io.h>
29#include <asm/arch/hardware.h> /* for CLPS7111_VIRT_BASE */ 29#include <asm/arch/hardware.h> /* for CLPS7111_VIRT_BASE */
30#include <asm/sizes.h> 30#include <asm/sizes.h>
31#include <asm/arch/h1900-gpio.h> 31#include <asm/arch/h1900-gpio.h>
32#include <asm/arch/ipaq.h> 32#include <asm/arch/ipaq.h>
@@ -45,23 +45,23 @@ static struct mtd_info *h1910_nand_mtd = NULL;
45 * Define static partitions for flash device 45 * Define static partitions for flash device
46 */ 46 */
47static struct mtd_partition partition_info[] = { 47static struct mtd_partition partition_info[] = {
48 { name: "h1910 NAND Flash", 48 {name:"h1910 NAND Flash",
49 offset: 0, 49 offset:0,
50 size: 16*1024*1024 } 50 size:16 * 1024 * 1024}
51}; 51};
52
52#define NUM_PARTITIONS 1 53#define NUM_PARTITIONS 1
53 54
54#endif 55#endif
55 56
56
57/* 57/*
58 * hardware specific access to control-lines 58 * hardware specific access to control-lines
59 */ 59 */
60static void h1910_hwcontrol(struct mtd_info *mtd, int cmd) 60static void h1910_hwcontrol(struct mtd_info *mtd, int cmd)
61{ 61{
62 struct nand_chip* this = (struct nand_chip *) (mtd->priv); 62 struct nand_chip *this = (struct nand_chip *)(mtd->priv);
63 63
64 switch(cmd) { 64 switch (cmd) {
65 65
66 case NAND_CTL_SETCLE: 66 case NAND_CTL_SETCLE:
67 this->IO_ADDR_R |= (1 << 2); 67 this->IO_ADDR_R |= (1 << 2);
@@ -101,7 +101,7 @@ static int h1910_device_ready(struct mtd_info *mtd)
101/* 101/*
102 * Main initialization routine 102 * Main initialization routine
103 */ 103 */
104static int __init h1910_init (void) 104static int __init h1910_init(void)
105{ 105{
106 struct nand_chip *this; 106 struct nand_chip *this;
107 const char *part_type = 0; 107 const char *part_type = 0;
@@ -119,21 +119,19 @@ static int __init h1910_init (void)
119 } 119 }
120 120
121 /* Allocate memory for MTD device structure and private data */ 121 /* Allocate memory for MTD device structure and private data */
122 h1910_nand_mtd = kmalloc(sizeof(struct mtd_info) + 122 h1910_nand_mtd = kmalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip), GFP_KERNEL);
123 sizeof(struct nand_chip),
124 GFP_KERNEL);
125 if (!h1910_nand_mtd) { 123 if (!h1910_nand_mtd) {
126 printk("Unable to allocate h1910 NAND MTD device structure.\n"); 124 printk("Unable to allocate h1910 NAND MTD device structure.\n");
127 iounmap ((void *) nandaddr); 125 iounmap((void *)nandaddr);
128 return -ENOMEM; 126 return -ENOMEM;
129 } 127 }
130 128
131 /* Get pointer to private data */ 129 /* Get pointer to private data */
132 this = (struct nand_chip *) (&h1910_nand_mtd[1]); 130 this = (struct nand_chip *)(&h1910_nand_mtd[1]);
133 131
134 /* Initialize structures */ 132 /* Initialize structures */
135 memset((char *) h1910_nand_mtd, 0, sizeof(struct mtd_info)); 133 memset(h1910_nand_mtd, 0, sizeof(struct mtd_info));
136 memset((char *) this, 0, sizeof(struct nand_chip)); 134 memset(this, 0, sizeof(struct nand_chip));
137 135
138 /* Link the private data with the MTD structure */ 136 /* Link the private data with the MTD structure */
139 h1910_nand_mtd->priv = this; 137 h1910_nand_mtd->priv = this;
@@ -154,23 +152,20 @@ static int __init h1910_init (void)
154 this->options = NAND_NO_AUTOINCR; 152 this->options = NAND_NO_AUTOINCR;
155 153
156 /* Scan to find existence of the device */ 154 /* Scan to find existence of the device */
157 if (nand_scan (h1910_nand_mtd, 1)) { 155 if (nand_scan(h1910_nand_mtd, 1)) {
158 printk(KERN_NOTICE "No NAND device - returning -ENXIO\n"); 156 printk(KERN_NOTICE "No NAND device - returning -ENXIO\n");
159 kfree (h1910_nand_mtd); 157 kfree(h1910_nand_mtd);
160 iounmap ((void *) nandaddr); 158 iounmap((void *)nandaddr);
161 return -ENXIO; 159 return -ENXIO;
162 } 160 }
163
164#ifdef CONFIG_MTD_CMDLINE_PARTS 161#ifdef CONFIG_MTD_CMDLINE_PARTS
165 mtd_parts_nb = parse_cmdline_partitions(h1910_nand_mtd, &mtd_parts, 162 mtd_parts_nb = parse_cmdline_partitions(h1910_nand_mtd, &mtd_parts, "h1910-nand");
166 "h1910-nand");
167 if (mtd_parts_nb > 0) 163 if (mtd_parts_nb > 0)
168 part_type = "command line"; 164 part_type = "command line";
169 else 165 else
170 mtd_parts_nb = 0; 166 mtd_parts_nb = 0;
171#endif 167#endif
172 if (mtd_parts_nb == 0) 168 if (mtd_parts_nb == 0) {
173 {
174 mtd_parts = partition_info; 169 mtd_parts = partition_info;
175 mtd_parts_nb = NUM_PARTITIONS; 170 mtd_parts_nb = NUM_PARTITIONS;
176 part_type = "static"; 171 part_type = "static";
@@ -183,24 +178,26 @@ static int __init h1910_init (void)
183 /* Return happy */ 178 /* Return happy */
184 return 0; 179 return 0;
185} 180}
181
186module_init(h1910_init); 182module_init(h1910_init);
187 183
188/* 184/*
189 * Clean up routine 185 * Clean up routine
190 */ 186 */
191static void __exit h1910_cleanup (void) 187static void __exit h1910_cleanup(void)
192{ 188{
193 struct nand_chip *this = (struct nand_chip *) &h1910_nand_mtd[1]; 189 struct nand_chip *this = (struct nand_chip *)&h1910_nand_mtd[1];
194 190
195 /* Release resources, unregister device */ 191 /* Release resources, unregister device */
196 nand_release (h1910_nand_mtd); 192 nand_release(h1910_nand_mtd);
197 193
198 /* Release io resource */ 194 /* Release io resource */
199 iounmap ((void *) this->IO_ADDR_W); 195 iounmap((void *)this->IO_ADDR_W);
200 196
201 /* Free the MTD device structure */ 197 /* Free the MTD device structure */
202 kfree (h1910_nand_mtd); 198 kfree(h1910_nand_mtd);
203} 199}
200
204module_exit(h1910_cleanup); 201module_exit(h1910_cleanup);
205 202
206MODULE_LICENSE("GPL"); 203MODULE_LICENSE("GPL");