diff mbox

[U-Boot,v3,13/13] sf: Rename read register functions

Message ID 1441174197-5096-14-git-send-email-jteki@openedev.com
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Commit Message

Jagan Teki Sept. 2, 2015, 6:09 a.m. UTC
spi_flash_cmd_read_status -> read_sr
spi_flash_cmd_read_config -> read_cr

Signed-off-by: Jagan Teki <jteki@openedev.com>
---
Changes for v3:
	- none
Changes for v2:
	- none

 drivers/mtd/spi/sf_internal.h | 5 +----
 drivers/mtd/spi/sf_ops.c      | 8 ++++----
 drivers/mtd/spi/sf_probe.c    | 4 ++--
 3 files changed, 7 insertions(+), 10 deletions(-)

Comments

Bin Meng Sept. 15, 2015, 8:21 a.m. UTC | #1
Hi Jagan,

On Wed, Sep 2, 2015 at 2:09 PM, Jagan Teki <jteki@openedev.com> wrote:
> spi_flash_cmd_read_status -> read_sr
> spi_flash_cmd_read_config -> read_cr

Can you elaborate why this rename is needed? To me, read_sr() and
read_cr() are too generic names, and they are not static neither.

>
> Signed-off-by: Jagan Teki <jteki@openedev.com>
> ---
> Changes for v3:
>         - none
> Changes for v2:
>         - none
>
>  drivers/mtd/spi/sf_internal.h | 5 +----
>  drivers/mtd/spi/sf_ops.c      | 8 ++++----
>  drivers/mtd/spi/sf_probe.c    | 4 ++--
>  3 files changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
> index e4cb198..e618306 100644
> --- a/drivers/mtd/spi/sf_internal.h
> +++ b/drivers/mtd/spi/sf_internal.h
> @@ -180,14 +180,11 @@ int spi_flash_cmd_write(struct spi_slave *spi, const u8 *cmd, size_t cmd_len,
>  /* Flash erase(sectors) operation, support all possible erase commands */
>  int spi_flash_cmd_erase_ops(struct spi_flash *flash, u32 offset, size_t len);
>
> -/* Read the status register */
> -int spi_flash_cmd_read_status(struct spi_flash *flash);
> -
>  /* Program the status register */
>  int spi_flash_cmd_write_status(struct spi_flash *flash, u8 ws);
>
>  /* Read the config register */
> -int spi_flash_cmd_read_config(struct spi_flash *flash);
> +int read_cr(struct spi_flash *flash);
>
>  /* Program the config register */
>  int spi_flash_cmd_write_config(struct spi_flash *flash, u8 wc);
> diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c
> index 77b053a..a27beb5 100644
> --- a/drivers/mtd/spi/sf_ops.c
> +++ b/drivers/mtd/spi/sf_ops.c
> @@ -26,7 +26,7 @@ static void spi_flash_addr(u32 addr, u8 *cmd)
>         cmd[3] = addr >> 0;
>  }
>
> -int spi_flash_cmd_read_status(struct spi_flash *flash)
> +int read_sr(struct spi_flash *flash)
>  {
>         int ret;
>         u8 rs;
> @@ -70,7 +70,7 @@ int spi_flash_cmd_write_status(struct spi_flash *flash, u8 ws)
>  }
>
>  #if defined(CONFIG_SPI_FLASH_SPANSION) || defined(CONFIG_SPI_FLASH_WINBOND)
> -int spi_flash_cmd_read_config(struct spi_flash *flash)
> +int read_cr(struct spi_flash *flash)
>  {
>         int ret;
>         u8 rc;
> @@ -90,7 +90,7 @@ int spi_flash_cmd_write_config(struct spi_flash *flash, u8 wc)
>         u8 cmd;
>         int ret, val;
>
> -       val = spi_flash_cmd_read_status(flash);
> +       val = read_sr(flash);
>         if (val < 0)
>                 return val;
>
> @@ -160,7 +160,7 @@ static inline int write_cfsr(struct spi_flash *flash)
>
>  static inline int spi_flash_sr_ready(struct spi_flash *flash)
>  {
> -       int sr = spi_flash_cmd_read_status(flash);
> +       int sr = read_sr(flash);
>         if (sr < 0)
>                 return sr;
>         else
> diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c
> index 262849e..bf84f06 100644
> --- a/drivers/mtd/spi/sf_probe.c
> +++ b/drivers/mtd/spi/sf_probe.c
> @@ -37,7 +37,7 @@ static int spi_flash_set_qeb_mxic(struct spi_flash *flash)
>  {
>         int qeb_status, ret;
>
> -       qeb_status = spi_flash_cmd_read_config(flash);
> +       qeb_status = read_cr(flash);
>         if (qeb_status < 0)
>                 return qeb_status;
>
> @@ -58,7 +58,7 @@ static int spi_flash_set_qeb_winspan(struct spi_flash *flash)
>  {
>         int qeb_status, ret;
>
> -       qeb_status = spi_flash_cmd_read_config(flash);
> +       qeb_status = read_cr(flash);
>         if (qeb_status < 0)
>                 return qeb_status;
>
> --

Regards,
Bin
diff mbox

Patch

diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
index e4cb198..e618306 100644
--- a/drivers/mtd/spi/sf_internal.h
+++ b/drivers/mtd/spi/sf_internal.h
@@ -180,14 +180,11 @@  int spi_flash_cmd_write(struct spi_slave *spi, const u8 *cmd, size_t cmd_len,
 /* Flash erase(sectors) operation, support all possible erase commands */
 int spi_flash_cmd_erase_ops(struct spi_flash *flash, u32 offset, size_t len);
 
-/* Read the status register */
-int spi_flash_cmd_read_status(struct spi_flash *flash);
-
 /* Program the status register */
 int spi_flash_cmd_write_status(struct spi_flash *flash, u8 ws);
 
 /* Read the config register */
-int spi_flash_cmd_read_config(struct spi_flash *flash);
+int read_cr(struct spi_flash *flash);
 
 /* Program the config register */
 int spi_flash_cmd_write_config(struct spi_flash *flash, u8 wc);
diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c
index 77b053a..a27beb5 100644
--- a/drivers/mtd/spi/sf_ops.c
+++ b/drivers/mtd/spi/sf_ops.c
@@ -26,7 +26,7 @@  static void spi_flash_addr(u32 addr, u8 *cmd)
 	cmd[3] = addr >> 0;
 }
 
-int spi_flash_cmd_read_status(struct spi_flash *flash)
+int read_sr(struct spi_flash *flash)
 {
 	int ret;
 	u8 rs;
@@ -70,7 +70,7 @@  int spi_flash_cmd_write_status(struct spi_flash *flash, u8 ws)
 }
 
 #if defined(CONFIG_SPI_FLASH_SPANSION) || defined(CONFIG_SPI_FLASH_WINBOND)
-int spi_flash_cmd_read_config(struct spi_flash *flash)
+int read_cr(struct spi_flash *flash)
 {
 	int ret;
 	u8 rc;
@@ -90,7 +90,7 @@  int spi_flash_cmd_write_config(struct spi_flash *flash, u8 wc)
 	u8 cmd;
 	int ret, val;
 
-	val = spi_flash_cmd_read_status(flash);
+	val = read_sr(flash);
 	if (val < 0)
 		return val;
 
@@ -160,7 +160,7 @@  static inline int write_cfsr(struct spi_flash *flash)
 
 static inline int spi_flash_sr_ready(struct spi_flash *flash)
 {
-	int sr = spi_flash_cmd_read_status(flash);
+	int sr = read_sr(flash);
 	if (sr < 0)
 		return sr;
 	else
diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c
index 262849e..bf84f06 100644
--- a/drivers/mtd/spi/sf_probe.c
+++ b/drivers/mtd/spi/sf_probe.c
@@ -37,7 +37,7 @@  static int spi_flash_set_qeb_mxic(struct spi_flash *flash)
 {
 	int qeb_status, ret;
 
-	qeb_status = spi_flash_cmd_read_config(flash);
+	qeb_status = read_cr(flash);
 	if (qeb_status < 0)
 		return qeb_status;
 
@@ -58,7 +58,7 @@  static int spi_flash_set_qeb_winspan(struct spi_flash *flash)
 {
 	int qeb_status, ret;
 
-	qeb_status = spi_flash_cmd_read_config(flash);
+	qeb_status = read_cr(flash);
 	if (qeb_status < 0)
 		return qeb_status;