Re: [U-Boot] [PATCH v2 8/8] sf: Fix few naming convension for read modes

2015-12-30 Thread Mugunthan V N
On Tuesday 29 December 2015 03:19 PM, Jagan Teki wrote:
> spi_read_cmds =>  read_mode
> e_rd_cmd => flash_read
> spi_read_cmds_array => flash_read_cmd
> 
> All these are flash specific notation used in spi_flash
> core hence renamed to proper naming convensions related
> to flash.

$sub and commit: s/convension/convention

Regards
Mugunthan V N
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 8/8] sf: Fix few naming convension for read modes

2015-12-29 Thread Jagan Teki
spi_read_cmds =>  read_mode
e_rd_cmd => flash_read
spi_read_cmds_array => flash_read_cmd

All these are flash specific notation used in spi_flash
core hence renamed to proper naming convensions related
to flash.

Cc: Simon Glass 
Cc: Bin Meng 
CC: Mugunthan V N 
Cc: Michal Simek 
Cc: Siva Durga Prasad Paladugu 
Signed-off-by: Jagan Teki 
---
 drivers/mtd/spi/sf_internal.h |  2 +-
 drivers/mtd/spi/spi_flash.c   | 20 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
index 75513b0..89176db 100644
--- a/drivers/mtd/spi/sf_internal.h
+++ b/drivers/mtd/spi/sf_internal.h
@@ -21,7 +21,7 @@ enum spi_dual_flash {
 };
 
 /* Enum list - Full read commands */
-enum spi_read_cmds {
+enum read_mode {
ARRAY_SLOW  = BIT(0),
ARRAY_FAST  = BIT(1),
DUAL_OUTPUT_FAST= BIT(2),
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 2a7983c..95c1d46 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -44,7 +44,7 @@ struct flash_info {
u16 addr_width;
 
/* Enum list for read commands */
-   enum spi_read_cmds e_rd_cmd;
+   enum read_mode  flash_read;
 
u16 flags;
 #defineSECT_4K 0x01/* SPINOR_OP_BE_4K works 
uniformly */
@@ -868,7 +868,7 @@ int stm_unlock(struct spi_flash *flash, u32 ofs, size_t len)
 #endif
 
 /* Used when the "_ext_id" is two bytes at most */
-#define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors, _e_rd_cmd, _flags)  
\
+#define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors, _flash_read, 
_flags)\
.id = { \
((_jedec_id) >> 16) & 0xff, \
((_jedec_id) >> 8) & 0xff,  \
@@ -880,10 +880,10 @@ int stm_unlock(struct spi_flash *flash, u32 ofs, size_t 
len)
.sector_size = (_sector_size),  \
.n_sectors = (_n_sectors),  \
.page_size = 256,   \
-   .e_rd_cmd = _e_rd_cmd,  \
+   .flash_read = _flash_read,  
\
.flags = (_flags),
 
-#define INFO6(_jedec_id, _ext_id, _sector_size, _n_sectors, _e_rd_cmd, _flags) 
\
+#define INFO6(_jedec_id, _ext_id, _sector_size, _n_sectors, _flash_read, 
_flags)   \
.id = { \
((_jedec_id) >> 16) & 0xff, \
((_jedec_id) >> 8) & 0xff,  \
@@ -896,15 +896,15 @@ int stm_unlock(struct spi_flash *flash, u32 ofs, size_t 
len)
.sector_size = (_sector_size),  \
.n_sectors = (_n_sectors),  \
.page_size = 256,   \
-   .e_rd_cmd = _e_rd_cmd,  \
+   .flash_read = _flash_read,  
\
.flags = (_flags),
 
-#define CAT25_INFO(_sector_size, _n_sectors, _page_size, _addr_width, 
_e_rd_cmd, _flags)   \
+#define CAT25_INFO(_sector_size, _n_sectors, _page_size, _addr_width, 
_flash_read, _flags) \
.sector_size = (_sector_size),  \
.n_sectors = (_n_sectors),  \
.page_size = (_page_size),  \
.addr_width = (_addr_width),\
-   .e_rd_cmd = _e_rd_cmd,  \
+   .flash_read = _flash_read,  
\
.flags = (_flags),
 
 /* NOTE: double check command sets and memory organization when you add
@@ -1297,7 +1297,7 @@ int spi_flash_scan(struct spi_flash *flash)
 {
struct spi_slave *spi = flash->spi;
const struct flash_info *info = NULL;
-   static u8 spi_read_cmds_array[] = {
+   static u8 flash_read_cmd[] = {
CMD_READ_ARRAY_SLOW,
CMD_READ_ARRAY_FAST,
CMD_READ_DUAL_OUTPUT_FAST,
@@ -1397,9 +1397,9 @@ int spi_flash_scan(struct spi_flash *flash)
flash->sector_size = flash->erase_size;
 
/* Look for the fastest read cmd */
-   cmd = fls(info->e_rd_cmd & spi->mode_rx);
+   cmd = fls(info->flash_read & spi->mode_rx);
if (cmd) {
-   cmd = spi_read_cmds_array[cmd - 1];
+   cmd = flash_read_cmd[cmd - 1];
flash->read_cmd = cmd;