diff mbox series

mmc: sdhci-sprd: Fix error code in sdhci_sprd_tuning()

Message ID a8af0a08-8405-43cc-bd83-85ff25f572ca@moroto.mountain
State New
Headers show
Series mmc: sdhci-sprd: Fix error code in sdhci_sprd_tuning() | expand

Commit Message

Dan Carpenter Sept. 7, 2023, 9:54 a.m. UTC
Return an error code if sdhci_sprd_get_best_clk_sample() fails.
Currently, it returns success.

Fixes: d83d251bf3c2 ("mmc: sdhci-sprd: Add SD HS mode online tuning")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
This is from static analysis and has not been tested.
---
 drivers/mmc/host/sdhci-sprd.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Chunyan Zhang Sept. 8, 2023, 7:30 a.m. UTC | #1
+ Wenchao's gmail

On Thu, 7 Sept 2023 at 17:54, Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> Return an error code if sdhci_sprd_get_best_clk_sample() fails.
> Currently, it returns success.
>
> Fixes: d83d251bf3c2 ("mmc: sdhci-sprd: Add SD HS mode online tuning")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> This is from static analysis and has not been tested.
> ---
>  drivers/mmc/host/sdhci-sprd.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
> index 649ae075e229..6b84ba27e6ab 100644
> --- a/drivers/mmc/host/sdhci-sprd.c
> +++ b/drivers/mmc/host/sdhci-sprd.c
> @@ -644,6 +644,7 @@ static int sdhci_sprd_tuning(struct mmc_host *mmc, struct mmc_card *card,
>         best_clk_sample = sdhci_sprd_get_best_clk_sample(mmc, value);
>         if (best_clk_sample < 0) {
>                 dev_err(mmc_dev(host->mmc), "all tuning phase fail!\n");
> +               err = best_clk_sample;
>                 goto out;
>         }
>
> --
> 2.39.2
>
Wenchao Chen Sept. 8, 2023, 8:37 a.m. UTC | #2
On Fri, 8 Sept 2023 at 15:31, Chunyan Zhang <zhang.lyra@gmail.com> wrote:
>
> + Wenchao's gmail
>
> On Thu, 7 Sept 2023 at 17:54, Dan Carpenter <dan.carpenter@linaro.org> wrote:
> >
> > Return an error code if sdhci_sprd_get_best_clk_sample() fails.
> > Currently, it returns success.
> >
> > Fixes: d83d251bf3c2 ("mmc: sdhci-sprd: Add SD HS mode online tuning")
> > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> > ---

Reviewed-by: Wenchao Chen <wenchao.chen@unisoc.com>

Thanks,
Wenchao

> > This is from static analysis and has not been tested.
> > ---
> >  drivers/mmc/host/sdhci-sprd.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
> > index 649ae075e229..6b84ba27e6ab 100644
> > --- a/drivers/mmc/host/sdhci-sprd.c
> > +++ b/drivers/mmc/host/sdhci-sprd.c
> > @@ -644,6 +644,7 @@ static int sdhci_sprd_tuning(struct mmc_host *mmc, struct mmc_card *card,
> >         best_clk_sample = sdhci_sprd_get_best_clk_sample(mmc, value);
> >         if (best_clk_sample < 0) {
> >                 dev_err(mmc_dev(host->mmc), "all tuning phase fail!\n");
> > +               err = best_clk_sample;
> >                 goto out;
> >         }
> >
> > --
> > 2.39.2
> >
Baolin Wang Sept. 12, 2023, 1:16 a.m. UTC | #3
On 9/7/2023 5:54 PM, Dan Carpenter wrote:
> Return an error code if sdhci_sprd_get_best_clk_sample() fails.
> Currently, it returns success.
> 
> Fixes: d83d251bf3c2 ("mmc: sdhci-sprd: Add SD HS mode online tuning")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>

> ---
> This is from static analysis and has not been tested.
> ---
>   drivers/mmc/host/sdhci-sprd.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
> index 649ae075e229..6b84ba27e6ab 100644
> --- a/drivers/mmc/host/sdhci-sprd.c
> +++ b/drivers/mmc/host/sdhci-sprd.c
> @@ -644,6 +644,7 @@ static int sdhci_sprd_tuning(struct mmc_host *mmc, struct mmc_card *card,
>   	best_clk_sample = sdhci_sprd_get_best_clk_sample(mmc, value);
>   	if (best_clk_sample < 0) {
>   		dev_err(mmc_dev(host->mmc), "all tuning phase fail!\n");
> +		err = best_clk_sample;
>   		goto out;
>   	}
>
Adrian Hunter Sept. 12, 2023, 9:41 a.m. UTC | #4
On 7/09/23 12:54, Dan Carpenter wrote:
> Return an error code if sdhci_sprd_get_best_clk_sample() fails.
> Currently, it returns success.
> 
> Fixes: d83d251bf3c2 ("mmc: sdhci-sprd: Add SD HS mode online tuning")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> This is from static analysis and has not been tested.
> ---
>  drivers/mmc/host/sdhci-sprd.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
> index 649ae075e229..6b84ba27e6ab 100644
> --- a/drivers/mmc/host/sdhci-sprd.c
> +++ b/drivers/mmc/host/sdhci-sprd.c
> @@ -644,6 +644,7 @@ static int sdhci_sprd_tuning(struct mmc_host *mmc, struct mmc_card *card,
>  	best_clk_sample = sdhci_sprd_get_best_clk_sample(mmc, value);
>  	if (best_clk_sample < 0) {
>  		dev_err(mmc_dev(host->mmc), "all tuning phase fail!\n");
> +		err = best_clk_sample;
>  		goto out;
>  	}
>  

Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Ulf Hansson Sept. 14, 2023, 2:47 p.m. UTC | #5
On Thu, 7 Sept 2023 at 11:54, Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> Return an error code if sdhci_sprd_get_best_clk_sample() fails.
> Currently, it returns success.
>
> Fixes: d83d251bf3c2 ("mmc: sdhci-sprd: Add SD HS mode online tuning")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Applied for fixes, thanks!

Kind regards
Uffe


> ---
> This is from static analysis and has not been tested.
> ---
>  drivers/mmc/host/sdhci-sprd.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
> index 649ae075e229..6b84ba27e6ab 100644
> --- a/drivers/mmc/host/sdhci-sprd.c
> +++ b/drivers/mmc/host/sdhci-sprd.c
> @@ -644,6 +644,7 @@ static int sdhci_sprd_tuning(struct mmc_host *mmc, struct mmc_card *card,
>         best_clk_sample = sdhci_sprd_get_best_clk_sample(mmc, value);
>         if (best_clk_sample < 0) {
>                 dev_err(mmc_dev(host->mmc), "all tuning phase fail!\n");
> +               err = best_clk_sample;
>                 goto out;
>         }
>
> --
> 2.39.2
>
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
index 649ae075e229..6b84ba27e6ab 100644
--- a/drivers/mmc/host/sdhci-sprd.c
+++ b/drivers/mmc/host/sdhci-sprd.c
@@ -644,6 +644,7 @@  static int sdhci_sprd_tuning(struct mmc_host *mmc, struct mmc_card *card,
 	best_clk_sample = sdhci_sprd_get_best_clk_sample(mmc, value);
 	if (best_clk_sample < 0) {
 		dev_err(mmc_dev(host->mmc), "all tuning phase fail!\n");
+		err = best_clk_sample;
 		goto out;
 	}