Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 22/34] mmc: sdhci-of-k1: Drop the use of sdhci_pltfm_free()
       [not found] <cover.1747792905.git.zhoubinbin@loongson.cn>
@ 2025-05-26  6:06 ` Binbin Zhou
  2025-05-26 10:04   ` Yixun Lan
  0 siblings, 1 reply; 2+ messages in thread
From: Binbin Zhou @ 2025-05-26  6:06 UTC (permalink / raw)
  To: Binbin Zhou, Huacai Chen, Ulf Hansson, Adrian Hunter
  Cc: Huacai Chen, linux-mmc, Binbin Zhou, Yixun Lan, linux-riscv,
	spacemit

Since the devm_mmc_alloc_host() helper is already in
use, sdhci_pltfm_free() is no longer needed.

Cc: Yixun Lan <dlan@gentoo.org>
Cc: linux-riscv@lists.infradead.org
Cc: spacemit@lists.linux.dev
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
---
 drivers/mmc/host/sdhci-of-k1.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-k1.c b/drivers/mmc/host/sdhci-of-k1.c
index 6880d3e9ab62..40c1929f2de2 100644
--- a/drivers/mmc/host/sdhci-of-k1.c
+++ b/drivers/mmc/host/sdhci-of-k1.c
@@ -262,7 +262,7 @@ static int spacemit_sdhci_probe(struct platform_device *pdev)
 
 	ret = mmc_of_parse(host->mmc);
 	if (ret)
-		goto err_pltfm;
+		return ret;
 
 	sdhci_get_of_property(pdev);
 
@@ -276,18 +276,11 @@ static int spacemit_sdhci_probe(struct platform_device *pdev)
 
 	host->mmc->caps |= MMC_CAP_NEED_RSP_BUSY;
 
-	if (spacemit_sdhci_get_clocks(dev, pltfm_host))
-		goto err_pltfm;
-
-	ret = sdhci_add_host(host);
+	ret = spacemit_sdhci_get_clocks(dev, pltfm_host);
 	if (ret)
-		goto err_pltfm;
-
-	return 0;
+		return ret;
 
-err_pltfm:
-	sdhci_pltfm_free(pdev);
-	return ret;
+	return sdhci_add_host(host);
 }
 
 static struct platform_driver spacemit_sdhci_driver = {
-- 
2.47.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 22/34] mmc: sdhci-of-k1: Drop the use of sdhci_pltfm_free()
  2025-05-26  6:06 ` [PATCH 22/34] mmc: sdhci-of-k1: Drop the use of sdhci_pltfm_free() Binbin Zhou
@ 2025-05-26 10:04   ` Yixun Lan
  0 siblings, 0 replies; 2+ messages in thread
From: Yixun Lan @ 2025-05-26 10:04 UTC (permalink / raw)
  To: Binbin Zhou
  Cc: Binbin Zhou, Huacai Chen, Ulf Hansson, Adrian Hunter, Huacai Chen,
	linux-mmc, linux-riscv, spacemit

hi Binbin,

On 14:06 Mon 26 May     , Binbin Zhou wrote:
> Since the devm_mmc_alloc_host() helper is already in
> use, sdhci_pltfm_free() is no longer needed.
> 
> Cc: Yixun Lan <dlan@gentoo.org>
> Cc: linux-riscv@lists.infradead.org
> Cc: spacemit@lists.linux.dev
> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> ---
>  drivers/mmc/host/sdhci-of-k1.c | 15 ++++-----------
>  1 file changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-of-k1.c b/drivers/mmc/host/sdhci-of-k1.c
> index 6880d3e9ab62..40c1929f2de2 100644
> --- a/drivers/mmc/host/sdhci-of-k1.c
> +++ b/drivers/mmc/host/sdhci-of-k1.c
> @@ -262,7 +262,7 @@ static int spacemit_sdhci_probe(struct platform_device *pdev)
>  
>  	ret = mmc_of_parse(host->mmc);
>  	if (ret)
> -		goto err_pltfm;
> +		return ret;
>  
>  	sdhci_get_of_property(pdev);
>  
> @@ -276,18 +276,11 @@ static int spacemit_sdhci_probe(struct platform_device *pdev)
>  
>  	host->mmc->caps |= MMC_CAP_NEED_RSP_BUSY;
>  
> -	if (spacemit_sdhci_get_clocks(dev, pltfm_host))
> -		goto err_pltfm;
> -
> -	ret = sdhci_add_host(host);
> +	ret = spacemit_sdhci_get_clocks(dev, pltfm_host);
>  	if (ret)
> -		goto err_pltfm;
> -
> -	return 0;
> +		return ret;
>  
> -err_pltfm:
> -	sdhci_pltfm_free(pdev);
> -	return ret;
> +	return sdhci_add_host(host);
>  }
>  

although this patch looks good, but can you preserve the goto scheme?
we might add other error handlings as implement SD/SDIO in the future
(it also keeps the change minimal and easy to review)
 
-- 
Yixun Lan (dlan)

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-26 10:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cover.1747792905.git.zhoubinbin@loongson.cn>
2025-05-26  6:06 ` [PATCH 22/34] mmc: sdhci-of-k1: Drop the use of sdhci_pltfm_free() Binbin Zhou
2025-05-26 10:04   ` Yixun Lan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox