Commit 2ba863fae628bb5fe2ec4b803f639c1edb55ea33
1 parent
9f4322fd22
Exists in
master
and in
50 other branches
sf: Code cleanups
- comment typo's - func args have a proper names Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
Showing 4 changed files with 12 additions and 14 deletions Side-by-side Diff
drivers/mtd/spi/sf_internal.h
... | ... | @@ -20,11 +20,6 @@ |
20 | 20 | #define SPI_FLASH_CFI_MFR_MACRONIX 0xc2 |
21 | 21 | #define SPI_FLASH_CFI_MFR_WINBOND 0xef |
22 | 22 | |
23 | -/* SECT flags */ | |
24 | -#define SECT_4K (1 << 1) | |
25 | -#define SECT_32K (1 << 2) | |
26 | -#define E_FSR (1 << 3) | |
27 | - | |
28 | 23 | /* Erase commands */ |
29 | 24 | #define CMD_ERASE_4K 0x20 |
30 | 25 | #define CMD_ERASE_32K 0x52 |
31 | 26 | |
... | ... | @@ -60,10 +55,10 @@ |
60 | 55 | #endif |
61 | 56 | |
62 | 57 | /* Common status */ |
63 | -#define STATUS_WIP 0x01 | |
58 | +#define STATUS_WIP (1 << 0) | |
64 | 59 | #define STATUS_QEB_WINSPAN (1 << 1) |
65 | 60 | #define STATUS_QEB_MXIC (1 << 6) |
66 | -#define STATUS_PEC 0x80 | |
61 | +#define STATUS_PEC (1 << 7) | |
67 | 62 | |
68 | 63 | /* Flash timeout values */ |
69 | 64 | #define SPI_FLASH_PROG_TIMEOUT (2 * CONFIG_SYS_HZ) |
... | ... | @@ -105,7 +100,7 @@ |
105 | 100 | int spi_flash_cmd_read_status(struct spi_flash *flash, u8 *rs); |
106 | 101 | |
107 | 102 | /* Program the status register */ |
108 | -int spi_flash_cmd_write_status(struct spi_flash *flash, u8 sr); | |
103 | +int spi_flash_cmd_write_status(struct spi_flash *flash, u8 ws); | |
109 | 104 | |
110 | 105 | /* Read the config register */ |
111 | 106 | int spi_flash_cmd_read_config(struct spi_flash *flash, u8 *rc); |
drivers/mtd/spi/sf_ops.c
... | ... | @@ -39,13 +39,13 @@ |
39 | 39 | return 0; |
40 | 40 | } |
41 | 41 | |
42 | -int spi_flash_cmd_write_status(struct spi_flash *flash, u8 sr) | |
42 | +int spi_flash_cmd_write_status(struct spi_flash *flash, u8 ws) | |
43 | 43 | { |
44 | 44 | u8 cmd; |
45 | 45 | int ret; |
46 | 46 | |
47 | 47 | cmd = CMD_WRITE_STATUS; |
48 | - ret = spi_flash_write_common(flash, &cmd, 1, &sr, 1); | |
48 | + ret = spi_flash_write_common(flash, &cmd, 1, &ws, 1); | |
49 | 49 | if (ret < 0) { |
50 | 50 | debug("SF: fail to write status register\n"); |
51 | 51 | return ret; |
... | ... | @@ -279,7 +279,7 @@ |
279 | 279 | |
280 | 280 | spi_flash_addr(offset, cmd); |
281 | 281 | |
282 | - debug("PP: 0x%p => cmd = { 0x%02x 0x%02x%02x%02x } chunk_len = %zu\n", | |
282 | + debug("SF: 0x%p => cmd = { 0x%02x 0x%02x%02x%02x } chunk_len = %zu\n", | |
283 | 283 | buf + actual, cmd[0], cmd[1], cmd[2], cmd[3], chunk_len); |
284 | 284 | |
285 | 285 | ret = spi_flash_write_common(flash, cmd, sizeof(cmd), |
drivers/mtd/spi/sf_probe.c
... | ... | @@ -167,7 +167,7 @@ |
167 | 167 | cmd = spi_read_cmds_array[cmd - 1]; |
168 | 168 | flash->read_cmd = cmd; |
169 | 169 | } else { |
170 | - /* Go for for default supported read cmd */ | |
170 | + /* Go for default supported read cmd */ | |
171 | 171 | flash->read_cmd = CMD_READ_ARRAY_FAST; |
172 | 172 | } |
173 | 173 | |
... | ... | @@ -207,7 +207,7 @@ |
207 | 207 | flash->dummy_byte = 1; |
208 | 208 | } |
209 | 209 | |
210 | - /* Poll cmd seclection */ | |
210 | + /* Poll cmd selection */ | |
211 | 211 | flash->poll_cmd = CMD_READ_STATUS; |
212 | 212 | #ifdef CONFIG_SPI_FLASH_STMICRO |
213 | 213 | if (params->flags & E_FSR) |
include/spi_flash.h
... | ... | @@ -19,7 +19,10 @@ |
19 | 19 | #include <linux/types.h> |
20 | 20 | #include <linux/compiler.h> |
21 | 21 | |
22 | -/* No enum list for write commands only QPP */ | |
22 | +/* sf param flags */ | |
23 | +#define SECT_4K 1 << 1 | |
24 | +#define SECT_32K 1 << 2 | |
25 | +#define E_FSR 1 << 3 | |
23 | 26 | #define WR_QPP 1 << 4 |
24 | 27 | |
25 | 28 | /* Enum list - Full read commands */ |