Skip to contentSkip to conversation

mmc: sd: use HIGH_SPEED_BUS_SPEED in mmc_sd_switch_hs()

PATCH In review Jisheng Zhang 2 participants 2 messages Apr 10, 2020 – Apr 17, 2020 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sd: use HIGH_SPEED_BUS_SPEED in mmc_sd_switch_hs()

Use the well defined HIGH_SPEED_BUS_SPEED macro in mmc_sd_switch_hs() to make code more readable.

---
 drivers/mmc/core/sd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/core/sd.c +2 -2
index 76c7add367d5..43de3190d718 100644
@@ -376,11 +376,11 @@ int mmc_sd_switch_hs(struct mmc_card *card)
 	if (!status)
 		return -ENOMEM;
 
-	err = mmc_sd_switch(card, 1, 0, 1, status);
+	err = mmc_sd_switch(card, 1, 0, HIGH_SPEED_BUS_SPEED, status);
 	if (err)
 		goto out;
 
-	if ((status[16] & 0xF) != 1) {
+	if ((status[16] & 0xF) != HIGH_SPEED_BUS_SPEED) {
 		pr_warn("%s: Problem switching card into high-speed mode!\n",
 			mmc_hostname(card->host));
 		err = 0;
Signature · 1 line
2.26.0
#1 lore raw
Quoted 5 lines · Jisheng Zhang

Use the well defined HIGH_SPEED_BUS_SPEED macro in mmc_sd_switch_hs() to make code more readable.

Applied for next, thanks!

Kind regards
Uffe

Quoted 25 lines
---
 drivers/mmc/core/sd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/core/sd.c +2 -3
index 76c7add367d5..43de3190d718 100644
@@ -376,11 +376,11 @@ int mmc_sd_switch_hs(struct mmc_card *card)
        if (!status)
                return -ENOMEM;
 
-       err = mmc_sd_switch(card, 1, 0, 1, status);
+       err = mmc_sd_switch(card, 1, 0, HIGH_SPEED_BUS_SPEED, status);
        if (err)
                goto out;
 
-       if ((status[16] & 0xF) != 1) {
+       if ((status[16] & 0xF) != HIGH_SPEED_BUS_SPEED) {
                pr_warn("%s: Problem switching card into high-speed mode!\n",
                        mmc_hostname(card->host));
                err = 0;
--

2.26.0