Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-mmc@vger.kernel.org
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Subject: [RFC PATCH 03/11] mmc: rename mmc_can_ext_csd() to mmc_card_can_ext_csd()
Date: Tue,  1 Apr 2025 11:58:39 +0200	[thread overview]
Message-ID: <20250401095847.29271-4-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20250401095847.29271-1-wsa+renesas@sang-engineering.com>

mmc_can_* functions sometimes relate to the card and sometimes to the host.
Make it obvious by renaming this function to include 'card'. Also, convert to
proper bool type while we are here.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/core/mmc.c     | 8 ++++----
 drivers/mmc/core/mmc_ops.c | 4 ++--
 drivers/mmc/core/mmc_ops.h | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 0bcad3ec8c83..2b63eb608489 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -680,7 +680,7 @@ static int mmc_read_ext_csd(struct mmc_card *card)
 	u8 *ext_csd;
 	int err;
 
-	if (!mmc_can_ext_csd(card))
+	if (!mmc_card_can_ext_csd(card))
 		return 0;
 
 	err = mmc_get_ext_csd(card, &ext_csd);
@@ -959,7 +959,7 @@ static int mmc_select_powerclass(struct mmc_card *card)
 	int err, ddr;
 
 	/* Power class selection is supported for versions >= 4.0 */
-	if (!mmc_can_ext_csd(card))
+	if (!mmc_card_can_ext_csd(card))
 		return 0;
 
 	bus_width = host->ios.bus_width;
@@ -1022,7 +1022,7 @@ static int mmc_select_bus_width(struct mmc_card *card)
 	unsigned idx, bus_width = 0;
 	int err = 0;
 
-	if (!mmc_can_ext_csd(card) ||
+	if (!mmc_card_can_ext_csd(card) ||
 	    !(host->caps & (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)))
 		return 0;
 
@@ -1543,7 +1543,7 @@ static int mmc_select_timing(struct mmc_card *card)
 {
 	int err = 0;
 
-	if (!mmc_can_ext_csd(card))
+	if (!mmc_card_can_ext_csd(card))
 		goto bus_speed;
 
 	if (card->mmc_avail_type & EXT_CSD_CARD_TYPE_HS400ES) {
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
index 5c8e62e8f331..638e87a861bc 100644
--- a/drivers/mmc/core/mmc_ops.c
+++ b/drivers/mmc/core/mmc_ops.c
@@ -383,7 +383,7 @@ int mmc_get_ext_csd(struct mmc_card *card, u8 **new_ext_csd)
 	if (!card || !new_ext_csd)
 		return -EINVAL;
 
-	if (!mmc_can_ext_csd(card))
+	if (!mmc_card_can_ext_csd(card))
 		return -EOPNOTSUPP;
 
 	/*
@@ -944,7 +944,7 @@ static int mmc_interrupt_hpi(struct mmc_card *card)
 	return err;
 }
 
-int mmc_can_ext_csd(struct mmc_card *card)
+bool mmc_card_can_ext_csd(struct mmc_card *card)
 {
 	return (card && card->csd.mmca_vsn > CSD_SPEC_VER_3);
 }
diff --git a/drivers/mmc/core/mmc_ops.h b/drivers/mmc/core/mmc_ops.h
index 0df3ebd900d1..514c40ff4b4e 100644
--- a/drivers/mmc/core/mmc_ops.h
+++ b/drivers/mmc/core/mmc_ops.h
@@ -37,7 +37,7 @@ int mmc_send_cid(struct mmc_host *host, u32 *cid);
 int mmc_spi_read_ocr(struct mmc_host *host, int highcap, u32 *ocrp);
 int mmc_spi_set_crc(struct mmc_host *host, int use_crc);
 int mmc_bus_test(struct mmc_card *card, u8 bus_width);
-int mmc_can_ext_csd(struct mmc_card *card);
+bool mmc_card_can_ext_csd(struct mmc_card *card);
 int mmc_switch_status(struct mmc_card *card, bool crc_err_fatal);
 bool mmc_prepare_busy_cmd(struct mmc_host *host, struct mmc_command *cmd,
 			  unsigned int timeout_ms);
-- 
2.47.2


  parent reply	other threads:[~2025-04-01  9:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01  9:58 [RFC PATCH 00/11] mmc: rename mmc_can_* functions Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 01/11] mmc: rename mmc_can_discard() to mmc_card_can_discard() Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 02/11] mmc: rename mmc_can_erase() to mmc_card_can_erase() Wolfram Sang
2025-04-01  9:58 ` Wolfram Sang [this message]
2025-04-01  9:58 ` [RFC PATCH 04/11] mmc: rename mmc_can_poweroff_notify() to mmc_card_can_poweroff_notify() Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 05/11] mmc: rename mmc_can_reset() to mmc_card_can_reset() Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 06/11] mmc: rename mmc_can_sanitize() to mmc_card_can_sanitize() Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 07/11] mmc: rename mmc_can_secure_erase_trim() to mmc_card_can_secure_erase_trim() Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 08/11] mmc: rename mmc_can_sleep() to mmc_card_can_sleep() Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 09/11] mmc: rename mmc_can_trim() to mmc_card_can_trim() Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 10/11] mmc: rename mmc_can_gpio_cd() to mmc_host_can_gpio_cd() Wolfram Sang
2025-04-01  9:58 ` [RFC PATCH 11/11] mmc: rename mmc_can_gpio_ro() to mmc_host_can_gpio_ro() Wolfram Sang
2025-04-22 15:43 ` [RFC PATCH 00/11] mmc: rename mmc_can_* functions Ulf Hansson
2025-04-22 15:59   ` Wolfram Sang
2025-04-23 20:29   ` Wolfram Sang

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=20250401095847.29271-4-wsa+renesas@sang-engineering.com \
    --to=wsa+renesas@sang-engineering.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.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