From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta0.migadu.com (out-99.mta0.migadu.com [91.218.175.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F7471FD4 for ; Wed, 16 Sep 2026 00:34:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.99 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789518849; cv=none; b=O5NgU6q/cFoEyrupy4wD6tzAouLco0ebapCf+42a9U6s9E2QYfPL12HX2VEPzCOv+b7TY1BKOfRC0prOYh3Kok7Zni/2JlDXsxhowdb86jJCoVWm1buXou1+mR0Q20eJo6SnLAXen6my4T3AiA6gie+oCvPfoB5JyqNF3Uejw+Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789518849; c=relaxed/simple; bh=71YSysbM73J8M4gTfdyWpUgg7TRPpNjqYLUW3z1uREc=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=gylfw5G8FxW3K2O4s0kOspkAbitevA6QFybEbrB4aVRwMsWtWhSwYsELDQV8cH3eGsnZtlsAQW59e8SvQ+Xmq1h3pXKqbK9MBeczSSlnKRdcF0x1QfycthS/aGxDC5IOG9FGLjPNF/OSnDq3NnXhu6mVS6r+zJM9yQPYoUrIHMs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=aKIahy0Z; arc=none smtp.client-ip=91.218.175.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="aKIahy0Z" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=71YSysbM73J8M4gTfdyWpUgg7TRPpNjqYLUW3z1uREc=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1789518845; v=1; x=1790123645; b=aKIahy0ZXPJTdImTyEVVCc0OkQesMmxnod0xgWe6F67miWdo8+BrmwvSIupTZdLp8ZoyEd55 nfcPHFMNv6QHrxDwyXxaNnuSbHjvZRug22Lxd5EsSfTYn3XcKIyaqux63TRXxFIkDed4swYu9QD PevwMTZJ+OenF7QlT+jT4h5E= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 361132ff8be2991e; Wed, 16 Sep 2026 00:33:55 +0000 X-Mizu-Trace-ID: 361132ff8be2991e X-Migadu-Flow: FLOW_OUT Message-ID: <95955dcd-98ae-4130-91d7-a334818662cc@linux.dev> Date: Wed, 16 Sep 2026 08:33:46 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: shawn.lin@linux.dev, Rui Miguel Silva , Johan Hovold , Alex Elder , Greg Kroah-Hartman , 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 To: Ulf Hansson , linux-mmc@vger.kernel.org, Ulf Hansson References: <20260915132052.273212-1-ulf.hansson@oss.qualcomm.com> <20260915132052.273212-3-ulf.hansson@oss.qualcomm.com> From: Shawn Lin In-Reply-To: <20260915132052.273212-3-ulf.hansson@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 在 2026/09/15 星期二 21:20, Ulf Hansson 写道: > From: Ulf Hansson > > 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 > Signed-off-by: Ulf Hansson > --- > 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);