[PATCH v3 01/35] mmc: sdhci: Use devm_mmc_alloc_host() helper

Thierry Reding thierry.reding at gmail.com
Tue Jun 10 19:42:53 AEST 2025


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 at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20250610/e034fc5b/attachment.sig>


More information about the Linux-aspeed mailing list