diff mbox series

mmc: au1xmmc: Drop redundant code in au1xmmc_send_command()

Message ID 20200406114337.8802-1-ulf.hansson@linaro.org
State New
Headers show
Series mmc: au1xmmc: Drop redundant code in au1xmmc_send_command() | expand

Commit Message

Ulf Hansson April 6, 2020, 11:43 a.m. UTC
The in-parameter "wait" is always set to 0 by the caller, hence just drop
it and its corresponding code.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

---
 drivers/mmc/host/au1xmmc.c | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

-- 
2.20.1

Comments

Manuel Lauss April 6, 2020, 11:48 a.m. UTC | #1
On Mon, Apr 6, 2020 at 1:43 PM Ulf Hansson <ulf.hansson@linaro.org> wrote:
>
> The in-parameter "wait" is always set to 0 by the caller, hence just drop
> it and its corresponding code.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
>  drivers/mmc/host/au1xmmc.c | 20 ++------------------
>  1 file changed, 2 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c
> index 8823680ca42c..9bb1910268ca 100644
> --- a/drivers/mmc/host/au1xmmc.c
> +++ b/drivers/mmc/host/au1xmmc.c
> @@ -259,7 +259,7 @@ static void au1xmmc_tasklet_finish(unsigned long param)
>         au1xmmc_finish_request(host);
>  }
>
> -static int au1xmmc_send_command(struct au1xmmc_host *host, int wait,
> +static int au1xmmc_send_command(struct au1xmmc_host *host,
>                                 struct mmc_command *cmd, struct mmc_data *data)
>  {
>         u32 mmccmd = (cmd->opcode << SD_CMD_CI_SHIFT);
> @@ -302,9 +302,6 @@ static int au1xmmc_send_command(struct au1xmmc_host *host, int wait,
>         __raw_writel(cmd->arg, HOST_CMDARG(host));
>         wmb(); /* drain writebuffer */
>
> -       if (wait)
> -               IRQ_OFF(host, SD_CONFIG_CR);
> -
>         __raw_writel((mmccmd | SD_CMD_GO), HOST_CMD(host));
>         wmb(); /* drain writebuffer */
>
> @@ -312,19 +309,6 @@ static int au1xmmc_send_command(struct au1xmmc_host *host, int wait,
>         while (__raw_readl(HOST_CMD(host)) & SD_CMD_GO)
>                 /* nop */;
>
> -       /* Wait for the command to come back */
> -       if (wait) {
> -               u32 status = __raw_readl(HOST_STATUS(host));
> -
> -               while (!(status & SD_STATUS_CR))
> -                       status = __raw_readl(HOST_STATUS(host));
> -
> -               /* Clear the CR status */
> -               __raw_writel(SD_STATUS_CR, HOST_STATUS(host));
> -
> -               IRQ_ON(host, SD_CONFIG_CR);
> -       }
> -
>         return 0;
>  }
>
> @@ -711,7 +695,7 @@ static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq)
>         }
>
>         if (!ret)
> -               ret = au1xmmc_send_command(host, 0, mrq->cmd, mrq->data);
> +               ret = au1xmmc_send_command(host, mrq->cmd, mrq->data);
>
>         if (ret) {
>                 mrq->cmd->error = ret;
> --
> 2.20.1

Im fine with this, so:
Acked-by: Manuel Lauss <manuel.lauss@gmail.com>
diff mbox series

Patch

diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c
index 8823680ca42c..9bb1910268ca 100644
--- a/drivers/mmc/host/au1xmmc.c
+++ b/drivers/mmc/host/au1xmmc.c
@@ -259,7 +259,7 @@  static void au1xmmc_tasklet_finish(unsigned long param)
 	au1xmmc_finish_request(host);
 }
 
-static int au1xmmc_send_command(struct au1xmmc_host *host, int wait,
+static int au1xmmc_send_command(struct au1xmmc_host *host,
 				struct mmc_command *cmd, struct mmc_data *data)
 {
 	u32 mmccmd = (cmd->opcode << SD_CMD_CI_SHIFT);
@@ -302,9 +302,6 @@  static int au1xmmc_send_command(struct au1xmmc_host *host, int wait,
 	__raw_writel(cmd->arg, HOST_CMDARG(host));
 	wmb(); /* drain writebuffer */
 
-	if (wait)
-		IRQ_OFF(host, SD_CONFIG_CR);
-
 	__raw_writel((mmccmd | SD_CMD_GO), HOST_CMD(host));
 	wmb(); /* drain writebuffer */
 
@@ -312,19 +309,6 @@  static int au1xmmc_send_command(struct au1xmmc_host *host, int wait,
 	while (__raw_readl(HOST_CMD(host)) & SD_CMD_GO)
 		/* nop */;
 
-	/* Wait for the command to come back */
-	if (wait) {
-		u32 status = __raw_readl(HOST_STATUS(host));
-
-		while (!(status & SD_STATUS_CR))
-			status = __raw_readl(HOST_STATUS(host));
-
-		/* Clear the CR status */
-		__raw_writel(SD_STATUS_CR, HOST_STATUS(host));
-
-		IRQ_ON(host, SD_CONFIG_CR);
-	}
-
 	return 0;
 }
 
@@ -711,7 +695,7 @@  static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq)
 	}
 
 	if (!ret)
-		ret = au1xmmc_send_command(host, 0, mrq->cmd, mrq->data);
+		ret = au1xmmc_send_command(host, mrq->cmd, mrq->data);
 
 	if (ret) {
 		mrq->cmd->error = ret;