[PATCH 1/2] mci: sdhci: propagate tuning failures from sdhci_execute_tuning()

Ahmad Fatoum a.fatoum at pengutronix.de
Tue May 19 07:25:22 PDT 2026


On 5/19/26 4:15 PM, Sascha Hauer wrote:
> From: Sascha Hauer <sascha at saschahauer.de>
> 
> sdhci->tuning_err is set but never used. Drop it and return the tuning
> error directly from sdhci_execute_tuning(). With this we can actually
> return tuning errors instead of silently ignoring them.
> 
> Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>

Reviewed-by: Ahmad Fatoum <a.fatoum at pengutronix.de>

> ---
>  drivers/mci/sdhci.c | 2 +-
>  drivers/mci/sdhci.h | 1 -
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/mci/sdhci.c b/drivers/mci/sdhci.c
> index f7172347e1..1b13df8583 100644
> --- a/drivers/mci/sdhci.c
> +++ b/drivers/mci/sdhci.c
> @@ -353,7 +353,7 @@ int sdhci_execute_tuning(struct sdhci *sdhci, u32 opcode)
>  
>  	sdhci_start_tuning(sdhci);
>  
> -	sdhci->tuning_err = __sdhci_execute_tuning(sdhci, opcode);
> +	err = __sdhci_execute_tuning(sdhci, opcode);
>  
>  	sdhci_end_tuning(sdhci);
>  out:
> diff --git a/drivers/mci/sdhci.h b/drivers/mci/sdhci.h
> index 8d21febd7a..4a326f9d84 100644
> --- a/drivers/mci/sdhci.h
> +++ b/drivers/mci/sdhci.h
> @@ -280,7 +280,6 @@ struct sdhci {
>  
>  	unsigned int		tuning_count;	/* Timer count for re-tuning */
>  	unsigned int		tuning_mode;	/* Re-tuning mode supported by host */
> -	unsigned int		tuning_err;	/* Error code for re-tuning */
>  #define SDHCI_TUNING_MODE_1	0
>  #define SDHCI_TUNING_MODE_2	1
>  #define SDHCI_TUNING_MODE_3	2

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




More information about the barebox mailing list