mmc: sdhci-sprd: Fix error code in sdhci_sprd_tuning()
authorDan Carpenter <dan.carpenter@linaro.org>
Thu, 7 Sep 2023 09:54:50 +0000 (12:54 +0300)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 26 Sep 2023 13:08:05 +0000 (15:08 +0200)
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>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/a8af0a08-8405-43cc-bd83-85ff25f572ca@moroto.mountain
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-sprd.c

index 649ae07..6b84ba2 100644 (file)
@@ -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;
        }