Skip to content

Commit c41e43c

Browse files
ndreyscomputersforpeace
authored andcommitted
mtd: dataflash: Replace C99 types with their kernel counterparts
No functional change intended. Cc: [email protected] Cc: David Woodhouse <[email protected]> Cc: Brian Norris <[email protected]> Cc: Boris Brezillon <[email protected]> Cc: Marek Vasut <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Cyrille Pitchen <[email protected]> Cc: [email protected] Acked-by: Marek Vasut <[email protected]> Signed-off-by: Andrey Smirnov <[email protected]> Tested-by: Chris Healy <[email protected]> Signed-off-by: Brian Norris <[email protected]>
1 parent a940288 commit c41e43c

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

drivers/mtd/devices/mtd_dataflash.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484

8585

8686
struct dataflash {
87-
uint8_t command[4];
87+
u8 command[4];
8888
char name[24];
8989

9090
unsigned short page_offset; /* offset in flash address */
@@ -153,8 +153,8 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr)
153153
struct spi_transfer x = { };
154154
struct spi_message msg;
155155
unsigned blocksize = priv->page_size << 3;
156-
uint8_t *command;
157-
uint32_t rem;
156+
u8 *command;
157+
u32 rem;
158158

159159
pr_debug("%s: erase addr=0x%llx len 0x%llx\n",
160160
dev_name(&spi->dev), (long long)instr->addr,
@@ -187,8 +187,8 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr)
187187
pageaddr = pageaddr << priv->page_offset;
188188

189189
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);
192192
command[3] = 0;
193193

194194
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,
239239
struct spi_transfer x[2] = { };
240240
struct spi_message msg;
241241
unsigned int addr;
242-
uint8_t *command;
242+
u8 *command;
243243
int status;
244244

245245
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,
271271
* fewer "don't care" bytes. Both buffers stay unchanged.
272272
*/
273273
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);
277277
/* plus 4 "don't care" bytes */
278278

279279
status = spi_sync(priv->spi, &msg);
@@ -308,7 +308,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len,
308308
size_t remaining = len;
309309
u_char *writebuf = (u_char *) buf;
310310
int status = -EINVAL;
311-
uint8_t *command;
311+
u8 *command;
312312

313313
pr_debug("%s: write 0x%x..0x%x\n",
314314
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,
455455
}
456456

457457
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)
459459
{
460460
struct spi_message m;
461461
size_t l;
462-
uint8_t *scratch;
462+
u8 *scratch;
463463
struct spi_transfer t;
464464
int status;
465465

@@ -538,7 +538,7 @@ static int dataflash_write_user_otp(struct mtd_info *mtd,
538538
{
539539
struct spi_message m;
540540
const size_t l = 4 + 64;
541-
uint8_t *scratch;
541+
u8 *scratch;
542542
struct spi_transfer t;
543543
struct dataflash *priv = mtd->priv;
544544
int status;
@@ -689,14 +689,14 @@ struct flash_info {
689689
/* JEDEC id has a high byte of zero plus three data bytes:
690690
* the manufacturer id, then a two byte device id.
691691
*/
692-
uint32_t jedec_id;
692+
u32 jedec_id;
693693

694694
/* The size listed here is what works with OP_ERASE_PAGE. */
695695
unsigned nr_pages;
696-
uint16_t pagesize;
697-
uint16_t pageoffset;
696+
u16 pagesize;
697+
u16 pageoffset;
698698

699-
uint16_t flags;
699+
u16 flags;
700700
#define SUP_POW2PS 0x0002 /* supports 2^N byte pages */
701701
#define IS_POW2PS 0x0001 /* uses 2^N byte pages */
702702
};
@@ -739,9 +739,9 @@ static struct flash_info dataflash_data[] = {
739739
static struct flash_info *jedec_probe(struct spi_device *spi)
740740
{
741741
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;
745745
struct flash_info *info;
746746
int status;
747747

0 commit comments

Comments
 (0)