mmc: use defined macro for card status
PATCH 1/1 mmc: use defined macro for card status
Sometime we need to check the card status.
So using R1_CURRENT_STATE(status)..and compare with R1_STATE_xxx. But some code didn't use R1_STATE_xxx.
I think good that use defined macro for checking card status.
Signed-off-by Jaehoon Chung <[email protected]>
Signed-off-by Kyungmin Park <[email protected]>
--- drivers/mmc/card/mmc_test.c | 2 +- drivers/mmc/core/core.c | 2 +- drivers/mmc/core/mmc_ops.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/mmc/card/mmc_test.c +1 -1
@@ -224,7 +224,7 @@ static void mmc_test_prepare_mrq(struct mmc_test_card *test,static int mmc_test_busy (struct mmc_command *cmd) {return !(cmd->resp[0 ] &R1_READY_FOR_DATA ) || - (R1_CURRENT_STATE (cmd->resp[0 ]) ==7 ); + (R1_CURRENT_STATE (cmd->resp[0 ]) ==R1_STATE_PRG ); }/*
drivers/mmc/core/core.c +1 -1
@@ -1501,7 +1501,7 @@ static int mmc_do_erase(struct mmc_card *card, unsigned int from, goto out; } }while (!(cmd.resp[0 ] &R1_READY_FOR_DATA ) || -R1_CURRENT_STATE (cmd.resp[0 ]) ==7 ); +R1_CURRENT_STATE (cmd.resp[0 ]) ==R1_STATE_PRG ); out:return err; }
drivers/mmc/core/mmc_ops.c +1 -1
@@ -407,7 +407,7 @@ int mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,break ;if (mmc_host_is_spi (card->host))break ; - }while (R1_CURRENT_STATE (status) ==7 ); + }while (R1_CURRENT_STATE (status) ==R1_STATE_PRG );if (mmc_host_is_spi (card->host)) {if (status &R1_SPI_ILLEGAL_COMMAND )
Hi Jaehoon,
Quoted 45 lines · Jaehoon Chung
Sometime we need to check the card status.
So using R1_CURRENT_STATE(status)..and compare withR1_STATE_xxx. But some code didn't useR1_STATE_xxx.I think good that use defined macro for checking card status.
Signed-off-by Jaehoon Chung <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/mmc/card/mmc_test.c | 2 +- drivers/mmc/core/core.c | 2 +- drivers/mmc/core/mmc_ops.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)drivers/mmc/card/mmc_test.c +1
-1@@ -224,7 +224,7 @@ static void mmc_test_prepare_mrq(struct mmc_test_card *test,static int mmc_test_busy (struct mmc_command *cmd) {return !(cmd->resp[0 ] &R1_READY_FOR_DATA ) || - (R1_CURRENT_STATE (cmd->resp[0 ]) ==7 ); + (R1_CURRENT_STATE (cmd->resp[0 ]) ==R1_STATE_PRG ); }/* drivers/mmc/core/core.c +1
-1@@ -1501,7 +1501,7 @@ static int mmc_do_erase(struct mmc_card *card, unsigned int from, goto out; } }while (!(cmd.resp[0 ] &R1_READY_FOR_DATA ) || -R1_CURRENT_STATE (cmd.resp[0 ]) ==7 ); +R1_CURRENT_STATE (cmd.resp[0 ]) ==R1_STATE_PRG ); out:return err; }drivers/mmc/core/mmc_ops.c +0
-0
drivers/mmc/core/mmc_ops.c int mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value, · line 413
Quoted 8 lines
drivers/mmc/core/mmc_ops.c +1
-1@@ -407,7 +407,7 @@ int mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,break ;if (mmc_host_is_spi (card->host))break ; - }while (R1_CURRENT_STATE (status) ==7 ); + }while (R1_CURRENT_STATE (status) ==R1_STATE_PRG );if (mmc_host_is_spi (card->host)) {if (status &R1_SPI_ILLEGAL_COMMAND )
Thanks, pushed to mmc-next for 3.1.
- Chris.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child