diff mbox series

[-next] mmc: rtsx_usb_sdmmc: simplify the return expression of sd_change_phase()

Message ID 20200921131042.92340-1-miaoqinglang@huawei.com
State New
Headers show
Series [-next] mmc: rtsx_usb_sdmmc: simplify the return expression of sd_change_phase() | expand

Commit Message

'Qinglang Miao Sept. 21, 2020, 1:10 p.m. UTC
Simplify the return expression.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
 drivers/mmc/host/rtsx_usb_sdmmc.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Ulf Hansson Sept. 24, 2020, 12:49 p.m. UTC | #1
On Mon, 21 Sep 2020 at 15:10, Qinglang Miao <miaoqinglang@huawei.com> wrote:
>

> Simplify the return expression.

>

> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>


Applied for next, thanks!

Kind regards
Uffe


> ---

>  drivers/mmc/host/rtsx_usb_sdmmc.c | 7 +------

>  1 file changed, 1 insertion(+), 6 deletions(-)

>

> diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c

> index 598f49573..5fe4528e2 100644

> --- a/drivers/mmc/host/rtsx_usb_sdmmc.c

> +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c

> @@ -579,7 +579,6 @@ static void sd_normal_rw(struct rtsx_usb_sdmmc *host,

>  static int sd_change_phase(struct rtsx_usb_sdmmc *host, u8 sample_point, int tx)

>  {

>         struct rtsx_ucr *ucr = host->ucr;

> -       int err;

>

>         dev_dbg(sdmmc_dev(host), "%s: %s sample_point = %d\n",

>                         __func__, tx ? "TX" : "RX", sample_point);

> @@ -601,11 +600,7 @@ static int sd_change_phase(struct rtsx_usb_sdmmc *host, u8 sample_point, int tx)

>         rtsx_usb_add_cmd(ucr, WRITE_REG_CMD, CLK_DIV, CLK_CHANGE, 0);

>         rtsx_usb_add_cmd(ucr, WRITE_REG_CMD, SD_CFG1, SD_ASYNC_FIFO_RST, 0);

>

> -       err = rtsx_usb_send_cmd(ucr, MODE_C, 100);

> -       if (err)

> -               return err;

> -

> -       return 0;

> +       return rtsx_usb_send_cmd(ucr, MODE_C, 100);

>  }

>

>  static inline u32 get_phase_point(u32 phase_map, unsigned int idx)

> --

> 2.23.0

>
diff mbox series

Patch

diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c
index 598f49573..5fe4528e2 100644
--- a/drivers/mmc/host/rtsx_usb_sdmmc.c
+++ b/drivers/mmc/host/rtsx_usb_sdmmc.c
@@ -579,7 +579,6 @@  static void sd_normal_rw(struct rtsx_usb_sdmmc *host,
 static int sd_change_phase(struct rtsx_usb_sdmmc *host, u8 sample_point, int tx)
 {
 	struct rtsx_ucr *ucr = host->ucr;
-	int err;
 
 	dev_dbg(sdmmc_dev(host), "%s: %s sample_point = %d\n",
 			__func__, tx ? "TX" : "RX", sample_point);
@@ -601,11 +600,7 @@  static int sd_change_phase(struct rtsx_usb_sdmmc *host, u8 sample_point, int tx)
 	rtsx_usb_add_cmd(ucr, WRITE_REG_CMD, CLK_DIV, CLK_CHANGE, 0);
 	rtsx_usb_add_cmd(ucr, WRITE_REG_CMD, SD_CFG1, SD_ASYNC_FIFO_RST, 0);
 
-	err = rtsx_usb_send_cmd(ucr, MODE_C, 100);
-	if (err)
-		return err;
-
-	return 0;
+	return rtsx_usb_send_cmd(ucr, MODE_C, 100);
 }
 
 static inline u32 get_phase_point(u32 phase_map, unsigned int idx)