diff mbox series

[RFC,4/4] mmc: renesas_sdhi: simplify reset routine a little

Message ID 20201110142058.36393-5-wsa+renesas@sang-engineering.com (mailing list archive)
State Accepted
Delegated to: Geert Uytterhoeven
Headers show
Series mmc: renesas_sdhi: reset SCC only when available | expand

Commit Message

Wolfram Sang Nov. 10, 2020, 2:20 p.m. UTC
The 'reset' pointer is only populated for Gen2+. So, we don't need to
check for that flag inside the routine.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/renesas_sdhi_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Niklas Söderlund Nov. 11, 2020, 11:56 p.m. UTC | #1
Hi Wolfram,

Thanks for your work.

On 2020-11-10 15:20:58 +0100, Wolfram Sang wrote:
> The 'reset' pointer is only populated for Gen2+. So, we don't need to
> check for that flag inside the routine.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
>  drivers/mmc/host/renesas_sdhi_core.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
> index 4a1ed5bf216c..1fabf8c5773c 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -552,6 +552,7 @@ static int renesas_sdhi_prepare_hs400_tuning(struct mmc_host *mmc, struct mmc_io
>  	return 0;
>  }
>  
> +/* only populated for TMIO_MMC_MIN_RCAR2 */
>  static void renesas_sdhi_reset(struct tmio_mmc_host *host)
>  {
>  	struct renesas_sdhi *priv = host_to_priv(host);
> @@ -569,9 +570,7 @@ static void renesas_sdhi_reset(struct tmio_mmc_host *host)
>  			       sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_RVSCNTL));
>  	}
>  
> -	if (host->pdata->flags & TMIO_MMC_MIN_RCAR2)
> -		sd_ctrl_write32_as_16_and_16(host, CTL_IRQ_MASK,
> -					     TMIO_MASK_INIT_RCAR2);
> +	sd_ctrl_write32_as_16_and_16(host, CTL_IRQ_MASK, TMIO_MASK_INIT_RCAR2);
>  }
>  
>  #define SH_MOBILE_SDHI_MIN_TAP_ROW 3
> -- 
> 2.28.0
>
diff mbox series

Patch

diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 4a1ed5bf216c..1fabf8c5773c 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -552,6 +552,7 @@  static int renesas_sdhi_prepare_hs400_tuning(struct mmc_host *mmc, struct mmc_io
 	return 0;
 }
 
+/* only populated for TMIO_MMC_MIN_RCAR2 */
 static void renesas_sdhi_reset(struct tmio_mmc_host *host)
 {
 	struct renesas_sdhi *priv = host_to_priv(host);
@@ -569,9 +570,7 @@  static void renesas_sdhi_reset(struct tmio_mmc_host *host)
 			       sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_RVSCNTL));
 	}
 
-	if (host->pdata->flags & TMIO_MMC_MIN_RCAR2)
-		sd_ctrl_write32_as_16_and_16(host, CTL_IRQ_MASK,
-					     TMIO_MASK_INIT_RCAR2);
+	sd_ctrl_write32_as_16_and_16(host, CTL_IRQ_MASK, TMIO_MASK_INIT_RCAR2);
 }
 
 #define SH_MOBILE_SDHI_MIN_TAP_ROW 3