[U-Boot] [PATCH 1/2] sf: Rename spi_flash_set_* functions

Since quad_mode functions are local to spi flash core, rename them to a meaningful and readable names.
Signed-off-by: Jagan Teki jteki@openedev.com --- drivers/mtd/spi/spi_flash.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index 781e275..f58a587 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -797,7 +797,7 @@ int stm_unlock(struct spi_flash *flash, u32 ofs, size_t len)
#ifdef CONFIG_SPI_FLASH_MACRONIX -static int spi_flash_set_qeb_mxic(struct spi_flash *flash) +static int macronix_quad_enable(struct spi_flash *flash) { u8 qeb_status; int ret; @@ -819,7 +819,7 @@ static int spi_flash_set_qeb_mxic(struct spi_flash *flash) #endif
#if defined(CONFIG_SPI_FLASH_SPANSION) || defined(CONFIG_SPI_FLASH_WINBOND) -static int spi_flash_set_qeb_winspan(struct spi_flash *flash) +static int spansion_quad_enable(struct spi_flash *flash) { u8 qeb_status; int ret; @@ -840,17 +840,17 @@ static int spi_flash_set_qeb_winspan(struct spi_flash *flash) } #endif
-static int spi_flash_set_qeb(struct spi_flash *flash, u8 idcode0) +static int set_quad_mode(struct spi_flash *flash, u8 idcode0) { switch (idcode0) { #ifdef CONFIG_SPI_FLASH_MACRONIX case SPI_FLASH_CFI_MFR_MACRONIX: - return spi_flash_set_qeb_mxic(flash); + return macronix_quad_enable(flash); #endif #if defined(CONFIG_SPI_FLASH_SPANSION) || defined(CONFIG_SPI_FLASH_WINBOND) case SPI_FLASH_CFI_MFR_SPANSION: case SPI_FLASH_CFI_MFR_WINBOND: - return spi_flash_set_qeb_winspan(flash); + return spansion_quad_enable(flash); #endif #ifdef CONFIG_SPI_FLASH_STMICRO case SPI_FLASH_CFI_MFR_STMICRO: @@ -1045,7 +1045,7 @@ int spi_flash_scan(struct spi_flash *flash) if ((flash->read_cmd == CMD_READ_QUAD_OUTPUT_FAST) || (flash->read_cmd == CMD_READ_QUAD_IO_FAST) || (flash->write_cmd == CMD_QUAD_PAGE_PROGRAM)) { - ret = spi_flash_set_qeb(flash, idcode[0]); + ret = set_quad_mode(flash, idcode[0]); if (ret) { debug("SF: Fail to set QEB for %02x\n", idcode[0]); return -EINVAL;

bar_end gives more meaningfull compared to bank_end and spi_flash_write_bar uses bar_end so replaced bank_end with bar_end in spi_flash_read_bar
Signed-off-by: Jagan Teki jteki@openedev.com --- drivers/mtd/spi/spi_flash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index f58a587..9ffaf7d 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -139,7 +139,7 @@ static int spi_flash_read_bar(struct spi_flash *flash, u8 idcode0) int ret;
if (flash->size <= SPI_FLASH_16MB_BOUN) - goto bank_end; + goto bar_end;
switch (idcode0) { case SPI_FLASH_CFI_MFR_SPANSION: @@ -158,7 +158,7 @@ static int spi_flash_read_bar(struct spi_flash *flash, u8 idcode0) return ret; }
-bank_end: +bar_end: flash->bank_curr = curr_bank; return 0; }

On 13 December 2015 at 23:17, Jagan Teki jteki@openedev.com wrote:
bar_end gives more meaningfull compared to bank_end and spi_flash_write_bar uses bar_end so replaced bank_end with bar_end in spi_flash_read_bar
Signed-off-by: Jagan Teki jteki@openedev.com
Applied to u-boot-spi/master
thanks!

On 13 December 2015 at 23:17, Jagan Teki jteki@openedev.com wrote:
Since quad_mode functions are local to spi flash core, rename them to a meaningful and readable names.
Signed-off-by: Jagan Teki jteki@openedev.com
Applied to u-boot-spi/master
thanks!
participants (1)
-
Jagan Teki