mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shawn Lin <shawn.lin@linux.dev>
To: Ulf Hansson <ulf.hansson@oss.qualcomm.com>,
	linux-mmc@vger.kernel.org, Ulf Hansson <ulfh@kernel.org>
Cc: shawn.lin@linux.dev, Rui Miguel Silva <rmfrfs@gmail.com>,
	Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] mmc: core: Turn mmc_alloc|free_host() into static functions
Date: Wed, 16 Sep 2026 08:33:46 +0800	[thread overview]
Message-ID: <95955dcd-98ae-4130-91d7-a334818662cc@linux.dev> (raw)
In-Reply-To: <20260915132052.273212-3-ulf.hansson@oss.qualcomm.com>

在 2026/09/15 星期二 21:20, Ulf Hansson 写道:
> From: Ulf Hansson <ulfh@kernel.org>
> 
> As there are no longer any users of these functions, let's make them
> internal to the mmc core. While at it, let's also flip the order of the
> in-parameters to mmc_alloc_host() to be consistent with devm_alloc_host().
> 

Nice move when vub300 was gone,

Reviewed-by: Shawn Lin <shawn.lin@linux.dev>

> Signed-off-by: Ulf Hansson <ulfh@kernel.org>
> ---
>   drivers/mmc/core/host.c  | 35 +++++++++--------------------------
>   include/linux/mmc/host.h |  2 --
>   2 files changed, 9 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index 1bcf0e917b59..8e9e61839198 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -505,14 +505,7 @@ static int mmc_first_nonreserved_index(void)
>   	return max + 1;
>   }
>   
> -/**
> - *	mmc_alloc_host - initialise the per-host structure.
> - *	@extra: sizeof private data structure
> - *	@dev: pointer to host device model structure
> - *
> - *	Initialise the per-host structure.
> - */
> -struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
> +static struct mmc_host *mmc_alloc_host(struct device *dev, int extra)
>   {
>   	int index;
>   	struct mmc_host *host;
> @@ -583,7 +576,13 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
>   	return host;
>   }
>   
> -EXPORT_SYMBOL(mmc_alloc_host);
> +static void mmc_free_host(struct mmc_host *host)
> +{
> +	cancel_delayed_work_sync(&host->detect);
> +	cancel_work_sync(&host->sdio_irq_work);
> +	mmc_pwrseq_free(host);
> +	put_device(&host->class_dev);
> +}
>   
>   static void devm_mmc_host_release(struct device *dev, void *res)
>   {
> @@ -598,7 +597,7 @@ struct mmc_host *devm_mmc_alloc_host(struct device *dev, int extra)
>   	if (!dr)
>   		return NULL;
>   
> -	host = mmc_alloc_host(extra, dev);
> +	host = mmc_alloc_host(dev, extra);
>   	if (!host) {
>   		devres_free(dr);
>   		return NULL;
> @@ -692,19 +691,3 @@ void mmc_remove_host(struct mmc_host *host)
>   }
>   
>   EXPORT_SYMBOL(mmc_remove_host);
> -
> -/**
> - *	mmc_free_host - free the host structure
> - *	@host: mmc host
> - *
> - *	Free the host once all references to it have been dropped.
> - */
> -void mmc_free_host(struct mmc_host *host)
> -{
> -	cancel_delayed_work_sync(&host->detect);
> -	cancel_work_sync(&host->sdio_irq_work);
> -	mmc_pwrseq_free(host);
> -	put_device(&host->class_dev);
> -}
> -
> -EXPORT_SYMBOL(mmc_free_host);
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index ddb32bc2946f..198554e48346 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -585,11 +585,9 @@ struct mmc_host {
>   
>   struct device_node;
>   
> -struct mmc_host *mmc_alloc_host(int extra, struct device *);
>   struct mmc_host *devm_mmc_alloc_host(struct device *dev, int extra);
>   int mmc_add_host(struct mmc_host *);
>   void mmc_remove_host(struct mmc_host *);
> -void mmc_free_host(struct mmc_host *);
>   void mmc_of_parse_clk_phase(struct device *dev,
>   			    struct mmc_clk_phase_map *map);
>   int mmc_of_parse(struct mmc_host *host);


  reply	other threads:[~2026-09-16  0:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15 13:20 [PATCH 0/2] mmc: core: Avoid export of mmc_alloc|free_host() Ulf Hansson
2026-09-15 13:20 ` [PATCH 1/2] staging: greybus: sdio: Convert to devm_mmc_alloc_host() Ulf Hansson
2026-09-15 13:47   ` Rui Miguel Silva
2026-09-16  7:37   ` Greg Kroah-Hartman
2026-09-15 13:20 ` [PATCH 2/2] mmc: core: Turn mmc_alloc|free_host() into static functions Ulf Hansson
2026-09-16  0:33   ` Shawn Lin [this message]
2026-09-16  7:43   ` Johan Hovold
2026-09-16  9:36     ` Ulf Hansson
2026-09-16 10:00       ` Johan Hovold
2026-09-16 14:12         ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95955dcd-98ae-4130-91d7-a334818662cc@linux.dev \
    --to=shawn.lin@linux.dev \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=rmfrfs@gmail.com \
    --cc=ulf.hansson@oss.qualcomm.com \
    --cc=ulfh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®