From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jagan Teki Date: Sat, 19 Dec 2015 19:43:38 +0530 Subject: [U-Boot] [PATCH 8/8] sf: Fix few naming convension for read modes In-Reply-To: <1450534418-5007-1-git-send-email-jteki@openedev.com> References: <1450534418-5007-1-git-send-email-jteki@openedev.com> Message-ID: <1450534418-5007-9-git-send-email-jteki@openedev.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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: 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 62f419f..ec0beba 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 72b59fb..d1cdb67 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; #define SECT_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; } else { /* Go for default supported read cmd */ -- 1.9.1