aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices/mtd_dataflash.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2008-06-04 12:43:22 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2008-06-04 12:43:22 -0400
commit271c5c59e00302494ffc299741e7fa2d63103e76 (patch)
treee9eb26107604c5c06c3c00aa26323db524da3733 /drivers/mtd/devices/mtd_dataflash.c
parente9d42227bdc96238676bd28feca5815fcff2d6a8 (diff)
[MTD] DataFlash: use proper types
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/devices/mtd_dataflash.c')
-rw-r--r--drivers/mtd/devices/mtd_dataflash.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
index acc3728872e3..54e36bfc2c3b 100644
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@ -82,7 +82,7 @@
82 82
83 83
84struct dataflash { 84struct dataflash {
85 u8 command[4]; 85 uint8_t command[4];
86 char name[24]; 86 char name[24];
87 87
88 unsigned partitioned:1; 88 unsigned partitioned:1;
@@ -150,7 +150,7 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr)
150 struct spi_transfer x = { .tx_dma = 0, }; 150 struct spi_transfer x = { .tx_dma = 0, };
151 struct spi_message msg; 151 struct spi_message msg;
152 unsigned blocksize = priv->page_size << 3; 152 unsigned blocksize = priv->page_size << 3;
153 u8 *command; 153 uint8_t *command;
154 154
155 DEBUG(MTD_DEBUG_LEVEL2, "%s: erase addr=0x%x len 0x%x\n", 155 DEBUG(MTD_DEBUG_LEVEL2, "%s: erase addr=0x%x len 0x%x\n",
156 spi->dev.bus_id, 156 spi->dev.bus_id,
@@ -182,8 +182,8 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr)
182 pageaddr = pageaddr << priv->page_offset; 182 pageaddr = pageaddr << priv->page_offset;
183 183
184 command[0] = do_block ? OP_ERASE_BLOCK : OP_ERASE_PAGE; 184 command[0] = do_block ? OP_ERASE_BLOCK : OP_ERASE_PAGE;
185 command[1] = (u8)(pageaddr >> 16); 185 command[1] = (uint8_t)(pageaddr >> 16);
186 command[2] = (u8)(pageaddr >> 8); 186 command[2] = (uint8_t)(pageaddr >> 8);
187 command[3] = 0; 187 command[3] = 0;
188 188
189 DEBUG(MTD_DEBUG_LEVEL3, "ERASE %s: (%x) %x %x %x [%i]\n", 189 DEBUG(MTD_DEBUG_LEVEL3, "ERASE %s: (%x) %x %x %x [%i]\n",
@@ -234,7 +234,7 @@ static int dataflash_read(struct mtd_info *mtd, loff_t from, size_t len,
234 struct spi_transfer x[2] = { { .tx_dma = 0, }, }; 234 struct spi_transfer x[2] = { { .tx_dma = 0, }, };
235 struct spi_message msg; 235 struct spi_message msg;
236 unsigned int addr; 236 unsigned int addr;
237 u8 *command; 237 uint8_t *command;
238 int status; 238 int status;
239 239
240 DEBUG(MTD_DEBUG_LEVEL2, "%s: read 0x%x..0x%x\n", 240 DEBUG(MTD_DEBUG_LEVEL2, "%s: read 0x%x..0x%x\n",
@@ -274,9 +274,9 @@ static int dataflash_read(struct mtd_info *mtd, loff_t from, size_t len,
274 * fewer "don't care" bytes. Both buffers stay unchanged. 274 * fewer "don't care" bytes. Both buffers stay unchanged.
275 */ 275 */
276 command[0] = OP_READ_CONTINUOUS; 276 command[0] = OP_READ_CONTINUOUS;
277 command[1] = (u8)(addr >> 16); 277 command[1] = (uint8_t)(addr >> 16);
278 command[2] = (u8)(addr >> 8); 278 command[2] = (uint8_t)(addr >> 8);
279 command[3] = (u8)(addr >> 0); 279 command[3] = (uint8_t)(addr >> 0);
280 /* plus 4 "don't care" bytes */ 280 /* plus 4 "don't care" bytes */
281 281
282 status = spi_sync(priv->spi, &msg); 282 status = spi_sync(priv->spi, &msg);
@@ -311,7 +311,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len,
311 size_t remaining = len; 311 size_t remaining = len;
312 u_char *writebuf = (u_char *) buf; 312 u_char *writebuf = (u_char *) buf;
313 int status = -EINVAL; 313 int status = -EINVAL;
314 u8 *command; 314 uint8_t *command;
315 315
316 DEBUG(MTD_DEBUG_LEVEL2, "%s: write 0x%x..0x%x\n", 316 DEBUG(MTD_DEBUG_LEVEL2, "%s: write 0x%x..0x%x\n",
317 spi->dev.bus_id, (unsigned)to, (unsigned)(to + len)); 317 spi->dev.bus_id, (unsigned)to, (unsigned)(to + len));
@@ -539,16 +539,16 @@ struct flash_info {
539 * a high byte of zero plus three data bytes: the manufacturer id, 539 * a high byte of zero plus three data bytes: the manufacturer id,
540 * then a two byte device id. 540 * then a two byte device id.
541 */ 541 */
542 u32 jedec_id; 542 uint32_t jedec_id;
543 543
544 /* The size listed here is what works with OPCODE_SE, which isn't 544 /* The size listed here is what works with OPCODE_SE, which isn't
545 * necessarily called a "sector" by the vendor. 545 * necessarily called a "sector" by the vendor.
546 */ 546 */
547 unsigned nr_pages; 547 unsigned nr_pages;
548 u16 pagesize; 548 uint16_t pagesize;
549 u16 pageoffset; 549 uint16_t pageoffset;
550 550
551 u16 flags; 551 uint16_t flags;
552#define SUP_POW2PS 0x02 552#define SUP_POW2PS 0x02
553#define IS_POW2PS 0x01 553#define IS_POW2PS 0x01
554}; 554};
@@ -582,9 +582,9 @@ static struct flash_info __devinitdata dataflash_data [] = {
582static struct flash_info *__devinit jedec_probe(struct spi_device *spi) 582static struct flash_info *__devinit jedec_probe(struct spi_device *spi)
583{ 583{
584 int tmp; 584 int tmp;
585 u8 code = OP_READ_ID; 585 uint8_t code = OP_READ_ID;
586 u8 id[3]; 586 uint8_t id[3];
587 u32 jedec; 587 uint32_t jedec;
588 struct flash_info *info; 588 struct flash_info *info;
589 int status; 589 int status;
590 590