|
84 | 84 |
|
85 | 85 |
|
86 | 86 | struct dataflash {
|
87 |
| - uint8_t command[4]; |
| 87 | + u8 command[4]; |
88 | 88 | char name[24];
|
89 | 89 |
|
90 | 90 | unsigned short page_offset; /* offset in flash address */
|
@@ -153,8 +153,8 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr)
|
153 | 153 | struct spi_transfer x = { };
|
154 | 154 | struct spi_message msg;
|
155 | 155 | unsigned blocksize = priv->page_size << 3;
|
156 |
| - uint8_t *command; |
157 |
| - uint32_t rem; |
| 156 | + u8 *command; |
| 157 | + u32 rem; |
158 | 158 |
|
159 | 159 | pr_debug("%s: erase addr=0x%llx len 0x%llx\n",
|
160 | 160 | dev_name(&spi->dev), (long long)instr->addr,
|
@@ -187,8 +187,8 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr)
|
187 | 187 | pageaddr = pageaddr << priv->page_offset;
|
188 | 188 |
|
189 | 189 | command[0] = do_block ? OP_ERASE_BLOCK : OP_ERASE_PAGE;
|
190 |
| - command[1] = (uint8_t)(pageaddr >> 16); |
191 |
| - command[2] = (uint8_t)(pageaddr >> 8); |
| 190 | + command[1] = (u8)(pageaddr >> 16); |
| 191 | + command[2] = (u8)(pageaddr >> 8); |
192 | 192 | command[3] = 0;
|
193 | 193 |
|
194 | 194 | pr_debug("ERASE %s: (%x) %x %x %x [%i]\n",
|
@@ -239,7 +239,7 @@ static int dataflash_read(struct mtd_info *mtd, loff_t from, size_t len,
|
239 | 239 | struct spi_transfer x[2] = { };
|
240 | 240 | struct spi_message msg;
|
241 | 241 | unsigned int addr;
|
242 |
| - uint8_t *command; |
| 242 | + u8 *command; |
243 | 243 | int status;
|
244 | 244 |
|
245 | 245 | pr_debug("%s: read 0x%x..0x%x\n", dev_name(&priv->spi->dev),
|
@@ -271,9 +271,9 @@ static int dataflash_read(struct mtd_info *mtd, loff_t from, size_t len,
|
271 | 271 | * fewer "don't care" bytes. Both buffers stay unchanged.
|
272 | 272 | */
|
273 | 273 | command[0] = OP_READ_CONTINUOUS;
|
274 |
| - command[1] = (uint8_t)(addr >> 16); |
275 |
| - command[2] = (uint8_t)(addr >> 8); |
276 |
| - command[3] = (uint8_t)(addr >> 0); |
| 274 | + command[1] = (u8)(addr >> 16); |
| 275 | + command[2] = (u8)(addr >> 8); |
| 276 | + command[3] = (u8)(addr >> 0); |
277 | 277 | /* plus 4 "don't care" bytes */
|
278 | 278 |
|
279 | 279 | status = spi_sync(priv->spi, &msg);
|
@@ -308,7 +308,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len,
|
308 | 308 | size_t remaining = len;
|
309 | 309 | u_char *writebuf = (u_char *) buf;
|
310 | 310 | int status = -EINVAL;
|
311 |
| - uint8_t *command; |
| 311 | + u8 *command; |
312 | 312 |
|
313 | 313 | pr_debug("%s: write 0x%x..0x%x\n",
|
314 | 314 | dev_name(&spi->dev), (unsigned)to, (unsigned)(to + len));
|
@@ -455,11 +455,11 @@ static int dataflash_get_otp_info(struct mtd_info *mtd, size_t len,
|
455 | 455 | }
|
456 | 456 |
|
457 | 457 | static ssize_t otp_read(struct spi_device *spi, unsigned base,
|
458 |
| - uint8_t *buf, loff_t off, size_t len) |
| 458 | + u8 *buf, loff_t off, size_t len) |
459 | 459 | {
|
460 | 460 | struct spi_message m;
|
461 | 461 | size_t l;
|
462 |
| - uint8_t *scratch; |
| 462 | + u8 *scratch; |
463 | 463 | struct spi_transfer t;
|
464 | 464 | int status;
|
465 | 465 |
|
@@ -538,7 +538,7 @@ static int dataflash_write_user_otp(struct mtd_info *mtd,
|
538 | 538 | {
|
539 | 539 | struct spi_message m;
|
540 | 540 | const size_t l = 4 + 64;
|
541 |
| - uint8_t *scratch; |
| 541 | + u8 *scratch; |
542 | 542 | struct spi_transfer t;
|
543 | 543 | struct dataflash *priv = mtd->priv;
|
544 | 544 | int status;
|
@@ -689,14 +689,14 @@ struct flash_info {
|
689 | 689 | /* JEDEC id has a high byte of zero plus three data bytes:
|
690 | 690 | * the manufacturer id, then a two byte device id.
|
691 | 691 | */
|
692 |
| - uint32_t jedec_id; |
| 692 | + u32 jedec_id; |
693 | 693 |
|
694 | 694 | /* The size listed here is what works with OP_ERASE_PAGE. */
|
695 | 695 | unsigned nr_pages;
|
696 |
| - uint16_t pagesize; |
697 |
| - uint16_t pageoffset; |
| 696 | + u16 pagesize; |
| 697 | + u16 pageoffset; |
698 | 698 |
|
699 |
| - uint16_t flags; |
| 699 | + u16 flags; |
700 | 700 | #define SUP_POW2PS 0x0002 /* supports 2^N byte pages */
|
701 | 701 | #define IS_POW2PS 0x0001 /* uses 2^N byte pages */
|
702 | 702 | };
|
@@ -739,9 +739,9 @@ static struct flash_info dataflash_data[] = {
|
739 | 739 | static struct flash_info *jedec_probe(struct spi_device *spi)
|
740 | 740 | {
|
741 | 741 | int tmp;
|
742 |
| - uint8_t code = OP_READ_ID; |
743 |
| - uint8_t id[3]; |
744 |
| - uint32_t jedec; |
| 742 | + u8 code = OP_READ_ID; |
| 743 | + u8 id[3]; |
| 744 | + u32 jedec; |
745 | 745 | struct flash_info *info;
|
746 | 746 | int status;
|
747 | 747 |
|
|
0 commit comments