diff mbox series

[v2,2/3] mmc: sdhci: not return error when SDMA is not supported

Message ID 20200218012546.15858-3-jh80.chung@samsung.com
State Accepted
Delegated to: Peng Fan
Headers show
Series None | expand

Commit Message

Jaehoon Chung Feb. 18, 2020, 1:25 a.m. UTC
If Host controller doesn't support SDMA, it doesn't need to return
error. Because it can be worked with PIO mode.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
---
Changelog on V2
- Keep printf message instead of debug

 drivers/mmc/sdhci.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Minkyu Kang Feb. 21, 2020, 5:50 a.m. UTC | #1
On 18/02/2020 10:25, Jaehoon Chung wrote:
> If Host controller doesn't support SDMA, it doesn't need to return
> error. Because it can be worked with PIO mode.
> 
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
> ---
> Changelog on V2
> - Keep printf message instead of debug
> 
>  drivers/mmc/sdhci.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> index 93c9049c5d..40bf2a5b2c 100644
> --- a/drivers/mmc/sdhci.c
> +++ b/drivers/mmc/sdhci.c
> @@ -729,13 +729,12 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
>  	debug("%s, caps: 0x%x\n", __func__, caps);
>  
>  #ifdef CONFIG_MMC_SDHCI_SDMA
> -	if (!(caps & SDHCI_CAN_DO_SDMA)) {
> +	if ((caps & SDHCI_CAN_DO_SDMA)) {

seems to redundant braces

> +		host->flags |= USE_SDMA;
> +	} else {
>  		printf("%s: Your controller doesn't support SDMA!!\n",
>  		       __func__);
> -		return -EINVAL;
>  	}
> -
> -	host->flags |= USE_SDMA;
>  #endif
>  #if CONFIG_IS_ENABLED(MMC_SDHCI_ADMA)
>  	if (!(caps & SDHCI_CAN_DO_ADMA2)) {
> 

Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>

Thanks,
Minkyu Kang.
diff mbox series

Patch

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 93c9049c5d..40bf2a5b2c 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -729,13 +729,12 @@  int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
 	debug("%s, caps: 0x%x\n", __func__, caps);
 
 #ifdef CONFIG_MMC_SDHCI_SDMA
-	if (!(caps & SDHCI_CAN_DO_SDMA)) {
+	if ((caps & SDHCI_CAN_DO_SDMA)) {
+		host->flags |= USE_SDMA;
+	} else {
 		printf("%s: Your controller doesn't support SDMA!!\n",
 		       __func__);
-		return -EINVAL;
 	}
-
-	host->flags |= USE_SDMA;
 #endif
 #if CONFIG_IS_ENABLED(MMC_SDHCI_ADMA)
 	if (!(caps & SDHCI_CAN_DO_ADMA2)) {