diff mbox series

[v3,19/35] mmc: sdhci-of-at91: Drop the use of sdhci_pltfm_free()

Message ID d64ed0f849277760d5b9ce04cfff1cd02ad43d19.1749127796.git.zhoubinbin@loongson.cn
State New
Headers show
Series mmc: Cleanup sdhci_pltfm_free()/sdhci_free_host() usage | expand

Commit Message

Binbin Zhou June 7, 2025, 7:38 a.m. UTC
Since the devm_mmc_alloc_host() helper is already in use,
sdhci_pltfm_free() is no longer needed.

Cc: Aubin Constans <aubin.constans@microchip.com>
Cc: Eugen Hristev <eugen.hristev@linaro.org>
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
---
 drivers/mmc/host/sdhci-of-at91.c | 30 +++++++++++-------------------
 1 file changed, 11 insertions(+), 19 deletions(-)

Comments

Aubin Constans June 10, 2025, 9:34 a.m. UTC | #1
On 07/06/2025 09:38, Binbin Zhou wrote:
> Since the devm_mmc_alloc_host() helper is already in use,
> sdhci_pltfm_free() is no longer needed.
> 
> Cc: Aubin Constans <aubin.constans@microchip.com>
> Cc: Eugen Hristev <eugen.hristev@linaro.org>
> Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: Claudiu Beznea <claudiu.beznea@tuxon.dev>
> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>

Acked-by: Aubin Constans <aubin.constans@microchip.com>

> ---
>   drivers/mmc/host/sdhci-of-at91.c | 30 +++++++++++-------------------
>   1 file changed, 11 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c
> index 97988ed37467..be80a457cd49 100644
> --- a/drivers/mmc/host/sdhci-of-at91.c
> +++ b/drivers/mmc/host/sdhci-of-at91.c
> @@ -333,32 +333,26 @@ static int sdhci_at91_probe(struct platform_device *pdev)
> 
>          priv->mainck = devm_clk_get(&pdev->dev, "baseclk");
>          if (IS_ERR(priv->mainck)) {
> -               if (soc_data->baseclk_is_generated_internally) {
> +               if (soc_data->baseclk_is_generated_internally)
>                          priv->mainck = NULL;
> -               } else {
> -                       dev_err(&pdev->dev, "failed to get baseclk\n");
> -                       ret = PTR_ERR(priv->mainck);
> -                       goto sdhci_pltfm_free;
> -               }
> +               else
> +                       return dev_err_probe(&pdev->dev, PTR_ERR(priv->mainck),
> +                                            "failed to get baseclk\n");
>          }
> 
>          priv->hclock = devm_clk_get(&pdev->dev, "hclock");
> -       if (IS_ERR(priv->hclock)) {
> -               dev_err(&pdev->dev, "failed to get hclock\n");
> -               ret = PTR_ERR(priv->hclock);
> -               goto sdhci_pltfm_free;
> -       }
> +       if (IS_ERR(priv->hclock))
> +               return dev_err_probe(&pdev->dev, PTR_ERR(priv->hclock),
> +                                    "failed to get hclock\n");
> 
>          priv->gck = devm_clk_get(&pdev->dev, "multclk");
> -       if (IS_ERR(priv->gck)) {
> -               dev_err(&pdev->dev, "failed to get multclk\n");
> -               ret = PTR_ERR(priv->gck);
> -               goto sdhci_pltfm_free;
> -       }
> +       if (IS_ERR(priv->gck))
> +               return dev_err_probe(&pdev->dev, PTR_ERR(priv->gck),
> +                                    "failed to get multclk\n");
> 
>          ret = sdhci_at91_set_clks_presets(&pdev->dev);
>          if (ret)
> -               goto sdhci_pltfm_free;
> +               return ret;
> 
>          priv->restore_needed = false;
> 
> @@ -438,8 +432,6 @@ static int sdhci_at91_probe(struct platform_device *pdev)
>          clk_disable_unprepare(priv->gck);
>          clk_disable_unprepare(priv->mainck);
>          clk_disable_unprepare(priv->hclock);
> -sdhci_pltfm_free:
> -       sdhci_pltfm_free(pdev);
>          return ret;
>   }
> 
> --
> 2.47.1
>
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c
index 97988ed37467..be80a457cd49 100644
--- a/drivers/mmc/host/sdhci-of-at91.c
+++ b/drivers/mmc/host/sdhci-of-at91.c
@@ -333,32 +333,26 @@  static int sdhci_at91_probe(struct platform_device *pdev)
 
 	priv->mainck = devm_clk_get(&pdev->dev, "baseclk");
 	if (IS_ERR(priv->mainck)) {
-		if (soc_data->baseclk_is_generated_internally) {
+		if (soc_data->baseclk_is_generated_internally)
 			priv->mainck = NULL;
-		} else {
-			dev_err(&pdev->dev, "failed to get baseclk\n");
-			ret = PTR_ERR(priv->mainck);
-			goto sdhci_pltfm_free;
-		}
+		else
+			return dev_err_probe(&pdev->dev, PTR_ERR(priv->mainck),
+					     "failed to get baseclk\n");
 	}
 
 	priv->hclock = devm_clk_get(&pdev->dev, "hclock");
-	if (IS_ERR(priv->hclock)) {
-		dev_err(&pdev->dev, "failed to get hclock\n");
-		ret = PTR_ERR(priv->hclock);
-		goto sdhci_pltfm_free;
-	}
+	if (IS_ERR(priv->hclock))
+		return dev_err_probe(&pdev->dev, PTR_ERR(priv->hclock),
+				     "failed to get hclock\n");
 
 	priv->gck = devm_clk_get(&pdev->dev, "multclk");
-	if (IS_ERR(priv->gck)) {
-		dev_err(&pdev->dev, "failed to get multclk\n");
-		ret = PTR_ERR(priv->gck);
-		goto sdhci_pltfm_free;
-	}
+	if (IS_ERR(priv->gck))
+		return dev_err_probe(&pdev->dev, PTR_ERR(priv->gck),
+				     "failed to get multclk\n");
 
 	ret = sdhci_at91_set_clks_presets(&pdev->dev);
 	if (ret)
-		goto sdhci_pltfm_free;
+		return ret;
 
 	priv->restore_needed = false;
 
@@ -438,8 +432,6 @@  static int sdhci_at91_probe(struct platform_device *pdev)
 	clk_disable_unprepare(priv->gck);
 	clk_disable_unprepare(priv->mainck);
 	clk_disable_unprepare(priv->hclock);
-sdhci_pltfm_free:
-	sdhci_pltfm_free(pdev);
 	return ret;
 }