]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mmc: sdhci-cadence: Drop the use of sdhci_pltfm_free()
authorBinbin Zhou <zhoubinbin@loongson.cn>
Sat, 7 Jun 2025 07:36:43 +0000 (15:36 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 24 Jun 2025 10:43:24 +0000 (12:43 +0200)
Since the devm_mmc_alloc_host() helper is already in use,
sdhci_pltfm_free() is no longer needed.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://lore.kernel.org/r/6269e0a4fac68f34a063391a4b53bf5ddee98d98.1749127796.git.zhoubinbin@loongson.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-cadence.c

index a94b297fcf2a34b5b91d324319bfc6496ba25751..a37e6a1f51279034f5df60c16df6c8a4bf9554c2 100644 (file)
@@ -515,7 +515,7 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
        if (data->init) {
                ret = data->init(pdev);
                if (ret)
-                       goto free;
+                       return ret;
        }
        sdhci_enable_v4_mode(host);
        __sdhci_read_caps(host, &version, NULL, NULL);
@@ -524,33 +524,24 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
 
        ret = mmc_of_parse(host->mmc);
        if (ret)
-               goto free;
+               return ret;
 
        sdhci_cdns_phy_param_parse(dev->of_node, priv);
 
        ret = sdhci_cdns_phy_init(priv);
        if (ret)
-               goto free;
+               return ret;
 
        if (host->mmc->caps & MMC_CAP_HW_RESET) {
                priv->rst_hw = devm_reset_control_get_optional_exclusive(dev, NULL);
-               if (IS_ERR(priv->rst_hw)) {
-                       ret = dev_err_probe(mmc_dev(host->mmc), PTR_ERR(priv->rst_hw),
+               if (IS_ERR(priv->rst_hw))
+                       return dev_err_probe(mmc_dev(host->mmc), PTR_ERR(priv->rst_hw),
                                            "reset controller error\n");
-                       goto free;
-               }
                if (priv->rst_hw)
                        host->mmc_host_ops.card_hw_reset = sdhci_cdns_mmc_hw_reset;
        }
 
-       ret = sdhci_add_host(host);
-       if (ret)
-               goto free;
-
-       return 0;
-free:
-       sdhci_pltfm_free(pdev);
-       return ret;
+       return sdhci_add_host(host);
 }
 
 #ifdef CONFIG_PM_SLEEP