linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/35] mmc: Cleanup sdhci_pltfm_free()/sdhci_free_host() usage
@ 2025-06-07  7:31 Binbin Zhou
  2025-06-07  7:33 ` [PATCH v3 01/35] mmc: sdhci: Use devm_mmc_alloc_host() helper Binbin Zhou
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Binbin Zhou @ 2025-06-07  7:31 UTC (permalink / raw)
  To: Binbin Zhou, Huacai Chen, Ulf Hansson, Adrian Hunter
  Cc: Huacai Chen, linux-mmc, Andrew Jeffery, Taichi Sugaya,
	Takao Orito, Ben Dooks, Jaehoon Chung, Florian Fainelli, Ray Jui,
	Scott Branden, Kamal Dasu, Al Cooper, Haibo Chen, Shawn Guo,
	Sascha Hauer, Fabio Estevam, imx, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair, openbmc,
	Michal Simek, Joel Stanley, linux-aspeed, Aubin Constans,
	Eugen Hristev, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Yixun Lan, linux-riscv, spacemit, Jacky Huang, Shan-Chun Hung,
	Steen Hegelund, Daniel Machon, Vignesh Raghavendra,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, linux-tegra,
	Hu Ziji, Binbin Zhou

Hi all:

After the first part of the cleanup[1], there are sdhci related
drivers that need further cleanup.

This patchset is the second part of the cleanup series, and since sdhci has
sdhci_alloc_host() as the general interface, our main job is to clean up
sdhci_pltfm_free() and sdhci_free_host().

[1]: https://lore.kernel.org/all/cover.1748933789.git.zhoubinbin@loongson.cn/

Thanks.

-----
V3:
- Collect Reviewed-by and Acked-by tags.
Patch-19:
  - Use dev_err_probe() to cleanup the code.
Patch-32:
  - Fix build warning by lkp:
	https://lore.kernel.org/all/202505300815.tjQRQD6z-lkp@intel.com/

Link to V2:
https://lore.kernel.org/all/cover.1748515612.git.zhoubinbin@loongson.cn/

V2:
- Collect Reviewed-by and Acked-by tags.

Patch-01:
 - Set sdhci_free_host() to empty, rather than dropping it.
Patch-07:
 - Set sdhci_pltfm_free() to empty, rather than dropping it.
Patch-22:
 - As requested by Yixun, retain the goto scheme.
Patch-35:
 - New patch;
 - Since all calls have been cleaned up, sdhci_pltfm_free()/sdhci_free_host()
   are now dropped directly;

Link to V1:
https://lore.kernel.org/all/cover.1747792905.git.zhoubinbin@loongson.cn/

Binbin Zhou (35):
  mmc: sdhci: Use devm_mmc_alloc_host() helper
  mmc: sdhci-acpi: Drop the use of sdhci_free_host()
  mmc: sdhci-milbeaut: Drop the use of sdhci_free_host()
  mmc: sdhci-pci: Drop the use of sdhci_free_host()
  mmc: sdhci-s3c: Drop the use of sdhci_free_host()
  mmc: sdhci-spear: Drop the use of sdhci_free_host()
  mmc: sdhci-pltfm: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-bcm-kona: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-brcmstb: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-cadence: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-dove: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-esdhc-imx: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-esdhc-mcf: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-iproc: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-msm: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-npcm: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-of-arasan: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-of-aspeed: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-of-at91: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-of-dwcmshc: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-of-esdhc: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-of-k1: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-of-ma35d1: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-of-sparx5: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-omap: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-pic32: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-pxav2: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-pxav3: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-sprd: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-st: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-tegra: Drop the use of sdhci_pltfm_free()
  mmc: sdhci-xenon: Drop the use of sdhci_pltfm_free()
  mmc: sdhci_am654: Drop the use of sdhci_pltfm_free()
  mmc: sdhci_f_sdh30: Drop the use of sdhci_pltfm_free()
  mmc: sdhci: Drop sdhci_free_host()/sdhci_pltfm_free() interface

 drivers/mmc/host/sdhci-acpi.c       |  3 ---
 drivers/mmc/host/sdhci-bcm-kona.c   |  2 --
 drivers/mmc/host/sdhci-brcmstb.c    |  1 -
 drivers/mmc/host/sdhci-cadence.c    | 21 ++++++------------
 drivers/mmc/host/sdhci-dove.c       | 12 ++---------
 drivers/mmc/host/sdhci-esdhc-imx.c  |  3 ---
 drivers/mmc/host/sdhci-esdhc-mcf.c  | 25 ++++++----------------
 drivers/mmc/host/sdhci-iproc.c      | 18 ++++------------
 drivers/mmc/host/sdhci-milbeaut.c   | 19 ++++++-----------
 drivers/mmc/host/sdhci-msm.c        | 11 ++++------
 drivers/mmc/host/sdhci-npcm.c       | 15 +++----------
 drivers/mmc/host/sdhci-of-arasan.c  | 26 +++++++----------------
 drivers/mmc/host/sdhci-of-aspeed.c  | 10 ++-------
 drivers/mmc/host/sdhci-of-at91.c    | 30 ++++++++++----------------
 drivers/mmc/host/sdhci-of-dwcmshc.c | 14 +++++-------
 drivers/mmc/host/sdhci-of-esdhc.c   | 11 ++--------
 drivers/mmc/host/sdhci-of-k1.c      |  1 -
 drivers/mmc/host/sdhci-of-ma35d1.c  | 23 +++++++-------------
 drivers/mmc/host/sdhci-of-sparx5.c  | 24 +++++++--------------
 drivers/mmc/host/sdhci-omap.c       | 21 ++++++------------
 drivers/mmc/host/sdhci-pci-core.c   |  9 ++------
 drivers/mmc/host/sdhci-pic32.c      |  9 +++-----
 drivers/mmc/host/sdhci-pltfm.c      | 16 +-------------
 drivers/mmc/host/sdhci-pltfm.h      |  1 -
 drivers/mmc/host/sdhci-pxav2.c      | 26 ++++++-----------------
 drivers/mmc/host/sdhci-pxav3.c      |  7 +-----
 drivers/mmc/host/sdhci-s3c.c        | 16 ++++----------
 drivers/mmc/host/sdhci-spear.c      | 11 ++++------
 drivers/mmc/host/sdhci-sprd.c       | 33 +++++++++--------------------
 drivers/mmc/host/sdhci-st.c         |  6 ++----
 drivers/mmc/host/sdhci-tegra.c      |  9 +++-----
 drivers/mmc/host/sdhci-xenon.c      | 15 +++++--------
 drivers/mmc/host/sdhci.c            |  9 +-------
 drivers/mmc/host/sdhci.h            |  1 -
 drivers/mmc/host/sdhci_am654.c      | 20 ++++++-----------
 drivers/mmc/host/sdhci_f_sdh30.c    | 13 ++++--------
 36 files changed, 135 insertions(+), 356 deletions(-)


base-commit: d2c6acff6386f43ed307822454b970c831c48f1b
-- 
2.47.1


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

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

* [PATCH v3 01/35] mmc: sdhci: Use devm_mmc_alloc_host() helper
  2025-06-07  7:31 [PATCH v3 00/35] mmc: Cleanup sdhci_pltfm_free()/sdhci_free_host() usage Binbin Zhou
@ 2025-06-07  7:33 ` Binbin Zhou
  2025-06-10  9:42   ` Thierry Reding
  2025-06-07  7:39 ` [PATCH v3 22/35] mmc: sdhci-of-k1: Drop the use of sdhci_pltfm_free() Binbin Zhou
  2025-06-19 11:19 ` [PATCH v3 00/35] mmc: Cleanup sdhci_pltfm_free()/sdhci_free_host() usage Ulf Hansson
  2 siblings, 1 reply; 7+ messages in thread
From: Binbin Zhou @ 2025-06-07  7:33 UTC (permalink / raw)
  To: Binbin Zhou, Huacai Chen, Ulf Hansson, Adrian Hunter
  Cc: Huacai Chen, linux-mmc, Andrew Jeffery, Taichi Sugaya,
	Takao Orito, Ben Dooks, Jaehoon Chung, Florian Fainelli, Ray Jui,
	Scott Branden, Kamal Dasu, Al Cooper, Haibo Chen, Shawn Guo,
	Sascha Hauer, Fabio Estevam, imx, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair, openbmc,
	Michal Simek, Joel Stanley, linux-aspeed, Aubin Constans,
	Eugen Hristev, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Yixun Lan, linux-riscv, spacemit, Jacky Huang, Shan-Chun Hung,
	Steen Hegelund, Daniel Machon, Vignesh Raghavendra,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, linux-tegra,
	Hu Ziji, Binbin Zhou

Use new function devm_mmc_alloc_host() to simplify the code.

Although sdhci_free_host() is no longer needed, to avoid drivers that still
use this function from failing to compile, sdhci_free_host() is temporarily
set to empty. Finally, it will be removed when there are no more callers.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
---
 drivers/mmc/host/sdhci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 32fa0b2bb912..ee5a5ae4db31 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -4076,7 +4076,7 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev,
 
 	WARN_ON(dev == NULL);
 
-	mmc = mmc_alloc_host(sizeof(struct sdhci_host) + priv_size, dev);
+	mmc = devm_mmc_alloc_host(dev, sizeof(struct sdhci_host) + priv_size);
 	if (!mmc)
 		return ERR_PTR(-ENOMEM);
 
@@ -5002,7 +5002,6 @@ EXPORT_SYMBOL_GPL(sdhci_remove_host);
 
 void sdhci_free_host(struct sdhci_host *host)
 {
-	mmc_free_host(host->mmc);
 }
 
 EXPORT_SYMBOL_GPL(sdhci_free_host);
-- 
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] 7+ messages in thread

* [PATCH v3 22/35] mmc: sdhci-of-k1: Drop the use of sdhci_pltfm_free()
  2025-06-07  7:31 [PATCH v3 00/35] mmc: Cleanup sdhci_pltfm_free()/sdhci_free_host() usage Binbin Zhou
  2025-06-07  7:33 ` [PATCH v3 01/35] mmc: sdhci: Use devm_mmc_alloc_host() helper Binbin Zhou
@ 2025-06-07  7:39 ` Binbin Zhou
  2025-06-19 11:19 ` [PATCH v3 00/35] mmc: Cleanup sdhci_pltfm_free()/sdhci_free_host() usage Ulf Hansson
  2 siblings, 0 replies; 7+ messages in thread
From: Binbin Zhou @ 2025-06-07  7:39 UTC (permalink / raw)
  To: Binbin Zhou, Huacai Chen, Ulf Hansson, Adrian Hunter
  Cc: Huacai Chen, linux-mmc, Andrew Jeffery, 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
Reviewed-by: Yixun Lan <dlan@gentoo.org>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
---
 drivers/mmc/host/sdhci-of-k1.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-of-k1.c b/drivers/mmc/host/sdhci-of-k1.c
index 6880d3e9ab62..026dc79af292 100644
--- a/drivers/mmc/host/sdhci-of-k1.c
+++ b/drivers/mmc/host/sdhci-of-k1.c
@@ -286,7 +286,6 @@ static int spacemit_sdhci_probe(struct platform_device *pdev)
 	return 0;
 
 err_pltfm:
-	sdhci_pltfm_free(pdev);
 	return ret;
 }
 
-- 
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] 7+ messages in thread

* Re: [PATCH v3 01/35] mmc: sdhci: Use devm_mmc_alloc_host() helper
  2025-06-07  7:33 ` [PATCH v3 01/35] mmc: sdhci: Use devm_mmc_alloc_host() helper Binbin Zhou
@ 2025-06-10  9:42   ` Thierry Reding
  2025-06-10 10:21     ` Binbin Zhou
  0 siblings, 1 reply; 7+ messages in thread
From: Thierry Reding @ 2025-06-10  9:42 UTC (permalink / raw)
  To: Binbin Zhou
  Cc: Binbin Zhou, Huacai Chen, Ulf Hansson, Adrian Hunter, Huacai Chen,
	linux-mmc, Andrew Jeffery, Taichi Sugaya, Takao Orito, Ben Dooks,
	Jaehoon Chung, Florian Fainelli, Ray Jui, Scott Branden,
	Kamal Dasu, Al Cooper, Haibo Chen, Shawn Guo, Sascha Hauer,
	Fabio Estevam, imx, Avi Fishman, Tomer Maimon, Tali Perry,
	Patrick Venture, Nancy Yuen, Benjamin Fair, openbmc, Michal Simek,
	Joel Stanley, linux-aspeed, Aubin Constans, Eugen Hristev,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Yixun Lan,
	linux-riscv, spacemit, Jacky Huang, Shan-Chun Hung,
	Steen Hegelund, Daniel Machon, Vignesh Raghavendra,
	Patrice Chotard, Jonathan Hunter, linux-tegra, Hu Ziji


[-- Attachment #1.1: Type: text/plain, Size: 1340 bytes --]

On Sat, Jun 07, 2025 at 03:33:34PM +0800, Binbin Zhou wrote:
> Use new function devm_mmc_alloc_host() to simplify the code.
> 
> Although sdhci_free_host() is no longer needed, to avoid drivers that still
> use this function from failing to compile, sdhci_free_host() is temporarily
> set to empty. Finally, it will be removed when there are no more callers.
> 
> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> ---
>  drivers/mmc/host/sdhci.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 32fa0b2bb912..ee5a5ae4db31 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -4076,7 +4076,7 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev,
>  
>  	WARN_ON(dev == NULL);
>  
> -	mmc = mmc_alloc_host(sizeof(struct sdhci_host) + priv_size, dev);
> +	mmc = devm_mmc_alloc_host(dev, sizeof(struct sdhci_host) + priv_size);
>  	if (!mmc)
>  		return ERR_PTR(-ENOMEM);
>  
> @@ -5002,7 +5002,6 @@ EXPORT_SYMBOL_GPL(sdhci_remove_host);
>  
>  void sdhci_free_host(struct sdhci_host *host)
>  {
> -	mmc_free_host(host->mmc);
>  }

Is there any point in keeping the sdhci_free_host() function around now?
I only see patches 1 and 31, so not sure if anything happens in between.

Thierry

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

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

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

* Re: [PATCH v3 01/35] mmc: sdhci: Use devm_mmc_alloc_host() helper
  2025-06-10  9:42   ` Thierry Reding
@ 2025-06-10 10:21     ` Binbin Zhou
  2025-06-10 11:15       ` Thierry Reding
  0 siblings, 1 reply; 7+ messages in thread
From: Binbin Zhou @ 2025-06-10 10:21 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Binbin Zhou, Huacai Chen, Ulf Hansson, Adrian Hunter, Huacai Chen,
	linux-mmc, Andrew Jeffery, Taichi Sugaya, Takao Orito, Ben Dooks,
	Jaehoon Chung, Florian Fainelli, Ray Jui, Scott Branden,
	Kamal Dasu, Al Cooper, Haibo Chen, Shawn Guo, Sascha Hauer,
	Fabio Estevam, imx, Avi Fishman, Tomer Maimon, Tali Perry,
	Patrick Venture, Nancy Yuen, Benjamin Fair, openbmc, Michal Simek,
	Joel Stanley, linux-aspeed, Aubin Constans, Eugen Hristev,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Yixun Lan,
	linux-riscv, spacemit, Jacky Huang, Shan-Chun Hung,
	Steen Hegelund, Daniel Machon, Vignesh Raghavendra,
	Patrice Chotard, Jonathan Hunter, linux-tegra, Hu Ziji

Hi Thierry:

On 2025/6/10 17:42, Thierry Reding wrote:
> On Sat, Jun 07, 2025 at 03:33:34PM +0800, Binbin Zhou wrote:
>> Use new function devm_mmc_alloc_host() to simplify the code.
>>
>> Although sdhci_free_host() is no longer needed, to avoid drivers that still
>> use this function from failing to compile, sdhci_free_host() is temporarily
>> set to empty. Finally, it will be removed when there are no more callers.
>>
>> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
>> ---
>>   drivers/mmc/host/sdhci.c | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>> index 32fa0b2bb912..ee5a5ae4db31 100644
>> --- a/drivers/mmc/host/sdhci.c
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -4076,7 +4076,7 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev,
>>   
>>   	WARN_ON(dev == NULL);
>>   
>> -	mmc = mmc_alloc_host(sizeof(struct sdhci_host) + priv_size, dev);
>> +	mmc = devm_mmc_alloc_host(dev, sizeof(struct sdhci_host) + priv_size);
>>   	if (!mmc)
>>   		return ERR_PTR(-ENOMEM);
>>   
>> @@ -5002,7 +5002,6 @@ EXPORT_SYMBOL_GPL(sdhci_remove_host);
>>   
>>   void sdhci_free_host(struct sdhci_host *host)
>>   {
>> -	mmc_free_host(host->mmc);
>>   }
> Is there any point in keeping the sdhci_free_host() function around now?
> I only see patches 1 and 31, so not sure if anything happens in between.

To minimize email delivery failures, I handle each driver patch by 
sending it to the relevant person, while sending patches 0 and 1 to 
everyone.

Keeping sdhci_free_host() as suggested by Adrian[1] is to minimize 
disruption to the compilation process. We first set sdhci_free_host() to 
empty, and once all callers have been cleaned up, we will remove it[2].

Of course, perhaps I should also CC the final patch[2] to everyone, 
which would make the entire process clearer.

[1]: 
https://lore.kernel.org/all/78ffbae6-1c75-46ac-a5d7-bbc07bca1fd0@intel.com/

[2]: 
https://lore.kernel.org/all/8adcfef00fd4bc40f33f5fd42d2e5e73d72e68e4.1749127796.git.zhoubinbin@loongson.cn/


Thanks.
Binbin

>
> Thierry


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

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

* Re: [PATCH v3 01/35] mmc: sdhci: Use devm_mmc_alloc_host() helper
  2025-06-10 10:21     ` Binbin Zhou
@ 2025-06-10 11:15       ` Thierry Reding
  0 siblings, 0 replies; 7+ messages in thread
From: Thierry Reding @ 2025-06-10 11:15 UTC (permalink / raw)
  To: Binbin Zhou
  Cc: Binbin Zhou, Huacai Chen, Ulf Hansson, Adrian Hunter, Huacai Chen,
	linux-mmc, Andrew Jeffery, Taichi Sugaya, Takao Orito, Ben Dooks,
	Jaehoon Chung, Florian Fainelli, Ray Jui, Scott Branden,
	Kamal Dasu, Al Cooper, Haibo Chen, Shawn Guo, Sascha Hauer,
	Fabio Estevam, imx, Avi Fishman, Tomer Maimon, Tali Perry,
	Patrick Venture, Nancy Yuen, Benjamin Fair, openbmc, Michal Simek,
	Joel Stanley, linux-aspeed, Aubin Constans, Eugen Hristev,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Yixun Lan,
	linux-riscv, spacemit, Jacky Huang, Shan-Chun Hung,
	Steen Hegelund, Daniel Machon, Vignesh Raghavendra,
	Patrice Chotard, Jonathan Hunter, linux-tegra, Hu Ziji


[-- Attachment #1.1: Type: text/plain, Size: 2272 bytes --]

On Tue, Jun 10, 2025 at 06:21:27PM +0800, Binbin Zhou wrote:
> Hi Thierry:
> 
> On 2025/6/10 17:42, Thierry Reding wrote:
> > On Sat, Jun 07, 2025 at 03:33:34PM +0800, Binbin Zhou wrote:
> > > Use new function devm_mmc_alloc_host() to simplify the code.
> > > 
> > > Although sdhci_free_host() is no longer needed, to avoid drivers that still
> > > use this function from failing to compile, sdhci_free_host() is temporarily
> > > set to empty. Finally, it will be removed when there are no more callers.
> > > 
> > > Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> > > ---
> > >   drivers/mmc/host/sdhci.c | 3 +--
> > >   1 file changed, 1 insertion(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> > > index 32fa0b2bb912..ee5a5ae4db31 100644
> > > --- a/drivers/mmc/host/sdhci.c
> > > +++ b/drivers/mmc/host/sdhci.c
> > > @@ -4076,7 +4076,7 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev,
> > >   	WARN_ON(dev == NULL);
> > > -	mmc = mmc_alloc_host(sizeof(struct sdhci_host) + priv_size, dev);
> > > +	mmc = devm_mmc_alloc_host(dev, sizeof(struct sdhci_host) + priv_size);
> > >   	if (!mmc)
> > >   		return ERR_PTR(-ENOMEM);
> > > @@ -5002,7 +5002,6 @@ EXPORT_SYMBOL_GPL(sdhci_remove_host);
> > >   void sdhci_free_host(struct sdhci_host *host)
> > >   {
> > > -	mmc_free_host(host->mmc);
> > >   }
> > Is there any point in keeping the sdhci_free_host() function around now?
> > I only see patches 1 and 31, so not sure if anything happens in between.
> 
> To minimize email delivery failures, I handle each driver patch by sending
> it to the relevant person, while sending patches 0 and 1 to everyone.
> 
> Keeping sdhci_free_host() as suggested by Adrian[1] is to minimize
> disruption to the compilation process. We first set sdhci_free_host() to
> empty, and once all callers have been cleaned up, we will remove it[2].
> 
> Of course, perhaps I should also CC the final patch[2] to everyone, which
> would make the entire process clearer.

Makes sense, and no worries. There's no great solution to this. Either
you send to everyone and you get complaints, or you send to too few
people and you get complaints.

Thanks for clarifying.

Thierry

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

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

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

* Re: [PATCH v3 00/35] mmc: Cleanup sdhci_pltfm_free()/sdhci_free_host() usage
  2025-06-07  7:31 [PATCH v3 00/35] mmc: Cleanup sdhci_pltfm_free()/sdhci_free_host() usage Binbin Zhou
  2025-06-07  7:33 ` [PATCH v3 01/35] mmc: sdhci: Use devm_mmc_alloc_host() helper Binbin Zhou
  2025-06-07  7:39 ` [PATCH v3 22/35] mmc: sdhci-of-k1: Drop the use of sdhci_pltfm_free() Binbin Zhou
@ 2025-06-19 11:19 ` Ulf Hansson
  2 siblings, 0 replies; 7+ messages in thread
From: Ulf Hansson @ 2025-06-19 11:19 UTC (permalink / raw)
  To: Binbin Zhou
  Cc: Binbin Zhou, Huacai Chen, Adrian Hunter, Huacai Chen, linux-mmc,
	Andrew Jeffery, Taichi Sugaya, Takao Orito, Ben Dooks,
	Jaehoon Chung, Florian Fainelli, Ray Jui, Scott Branden,
	Kamal Dasu, Al Cooper, Haibo Chen, Shawn Guo, Sascha Hauer,
	Fabio Estevam, imx, Avi Fishman, Tomer Maimon, Tali Perry,
	Patrick Venture, Nancy Yuen, Benjamin Fair, openbmc, Michal Simek,
	Joel Stanley, linux-aspeed, Aubin Constans, Eugen Hristev,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Yixun Lan,
	linux-riscv, spacemit, Jacky Huang, Shan-Chun Hung,
	Steen Hegelund, Daniel Machon, Vignesh Raghavendra,
	Patrice Chotard, Thierry Reding, Jonathan Hunter, linux-tegra,
	Hu Ziji

On Sat, 7 Jun 2025 at 09:32, Binbin Zhou <zhoubinbin@loongson.cn> wrote:
>
> Hi all:
>
> After the first part of the cleanup[1], there are sdhci related
> drivers that need further cleanup.
>
> This patchset is the second part of the cleanup series, and since sdhci has
> sdhci_alloc_host() as the general interface, our main job is to clean up
> sdhci_pltfm_free() and sdhci_free_host().
>
> [1]: https://lore.kernel.org/all/cover.1748933789.git.zhoubinbin@loongson.cn/
>
> Thanks.
>
> -----
> V3:
> - Collect Reviewed-by and Acked-by tags.
> Patch-19:
>   - Use dev_err_probe() to cleanup the code.
> Patch-32:
>   - Fix build warning by lkp:
>         https://lore.kernel.org/all/202505300815.tjQRQD6z-lkp@intel.com/
>
> Link to V2:
> https://lore.kernel.org/all/cover.1748515612.git.zhoubinbin@loongson.cn/
>
> V2:
> - Collect Reviewed-by and Acked-by tags.
>
> Patch-01:
>  - Set sdhci_free_host() to empty, rather than dropping it.
> Patch-07:
>  - Set sdhci_pltfm_free() to empty, rather than dropping it.
> Patch-22:
>  - As requested by Yixun, retain the goto scheme.
> Patch-35:
>  - New patch;
>  - Since all calls have been cleaned up, sdhci_pltfm_free()/sdhci_free_host()
>    are now dropped directly;
>
> Link to V1:
> https://lore.kernel.org/all/cover.1747792905.git.zhoubinbin@loongson.cn/
>
> Binbin Zhou (35):
>   mmc: sdhci: Use devm_mmc_alloc_host() helper
>   mmc: sdhci-acpi: Drop the use of sdhci_free_host()
>   mmc: sdhci-milbeaut: Drop the use of sdhci_free_host()
>   mmc: sdhci-pci: Drop the use of sdhci_free_host()
>   mmc: sdhci-s3c: Drop the use of sdhci_free_host()
>   mmc: sdhci-spear: Drop the use of sdhci_free_host()
>   mmc: sdhci-pltfm: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-bcm-kona: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-brcmstb: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-cadence: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-dove: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-esdhc-imx: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-esdhc-mcf: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-iproc: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-msm: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-npcm: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-of-arasan: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-of-aspeed: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-of-at91: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-of-dwcmshc: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-of-esdhc: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-of-k1: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-of-ma35d1: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-of-sparx5: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-omap: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-pic32: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-pxav2: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-pxav3: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-sprd: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-st: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-tegra: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci-xenon: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci_am654: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci_f_sdh30: Drop the use of sdhci_pltfm_free()
>   mmc: sdhci: Drop sdhci_free_host()/sdhci_pltfm_free() interface
>
>  drivers/mmc/host/sdhci-acpi.c       |  3 ---
>  drivers/mmc/host/sdhci-bcm-kona.c   |  2 --
>  drivers/mmc/host/sdhci-brcmstb.c    |  1 -
>  drivers/mmc/host/sdhci-cadence.c    | 21 ++++++------------
>  drivers/mmc/host/sdhci-dove.c       | 12 ++---------
>  drivers/mmc/host/sdhci-esdhc-imx.c  |  3 ---
>  drivers/mmc/host/sdhci-esdhc-mcf.c  | 25 ++++++----------------
>  drivers/mmc/host/sdhci-iproc.c      | 18 ++++------------
>  drivers/mmc/host/sdhci-milbeaut.c   | 19 ++++++-----------
>  drivers/mmc/host/sdhci-msm.c        | 11 ++++------
>  drivers/mmc/host/sdhci-npcm.c       | 15 +++----------
>  drivers/mmc/host/sdhci-of-arasan.c  | 26 +++++++----------------
>  drivers/mmc/host/sdhci-of-aspeed.c  | 10 ++-------
>  drivers/mmc/host/sdhci-of-at91.c    | 30 ++++++++++----------------
>  drivers/mmc/host/sdhci-of-dwcmshc.c | 14 +++++-------
>  drivers/mmc/host/sdhci-of-esdhc.c   | 11 ++--------
>  drivers/mmc/host/sdhci-of-k1.c      |  1 -
>  drivers/mmc/host/sdhci-of-ma35d1.c  | 23 +++++++-------------
>  drivers/mmc/host/sdhci-of-sparx5.c  | 24 +++++++--------------
>  drivers/mmc/host/sdhci-omap.c       | 21 ++++++------------
>  drivers/mmc/host/sdhci-pci-core.c   |  9 ++------
>  drivers/mmc/host/sdhci-pic32.c      |  9 +++-----
>  drivers/mmc/host/sdhci-pltfm.c      | 16 +-------------
>  drivers/mmc/host/sdhci-pltfm.h      |  1 -
>  drivers/mmc/host/sdhci-pxav2.c      | 26 ++++++-----------------
>  drivers/mmc/host/sdhci-pxav3.c      |  7 +-----
>  drivers/mmc/host/sdhci-s3c.c        | 16 ++++----------
>  drivers/mmc/host/sdhci-spear.c      | 11 ++++------
>  drivers/mmc/host/sdhci-sprd.c       | 33 +++++++++--------------------
>  drivers/mmc/host/sdhci-st.c         |  6 ++----
>  drivers/mmc/host/sdhci-tegra.c      |  9 +++-----
>  drivers/mmc/host/sdhci-xenon.c      | 15 +++++--------
>  drivers/mmc/host/sdhci.c            |  9 +-------
>  drivers/mmc/host/sdhci.h            |  1 -
>  drivers/mmc/host/sdhci_am654.c      | 20 ++++++-----------
>  drivers/mmc/host/sdhci_f_sdh30.c    | 13 ++++--------
>  36 files changed, 135 insertions(+), 356 deletions(-)
>
>

The series applied for next, thanks!

Kind regards
Uffe

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

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

end of thread, other threads:[~2025-06-19 15:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-07  7:31 [PATCH v3 00/35] mmc: Cleanup sdhci_pltfm_free()/sdhci_free_host() usage Binbin Zhou
2025-06-07  7:33 ` [PATCH v3 01/35] mmc: sdhci: Use devm_mmc_alloc_host() helper Binbin Zhou
2025-06-10  9:42   ` Thierry Reding
2025-06-10 10:21     ` Binbin Zhou
2025-06-10 11:15       ` Thierry Reding
2025-06-07  7:39 ` [PATCH v3 22/35] mmc: sdhci-of-k1: Drop the use of sdhci_pltfm_free() Binbin Zhou
2025-06-19 11:19 ` [PATCH v3 00/35] mmc: Cleanup sdhci_pltfm_free()/sdhci_free_host() usage Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).