summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authornongxiaoming <[email protected]>2021-12-30 18:25:07 +0800
committerBernard Xiong <[email protected]>2021-12-31 17:05:42 +0800
commitcec72c92c7315b8b83386a92a9c82f906e03ce40 (patch)
treebea94edb0b788b1138ec4cff1f30d0f1d2734730 /components
parent7bbf2605b7049301140e39dd615d65265c150102 (diff)
[components][sdio] fix compile warning and optimized code.
Diffstat (limited to 'components')
-rw-r--r--components/drivers/sdio/mmc.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/components/drivers/sdio/mmc.c b/components/drivers/sdio/mmc.c
index bebfa39ea2..ac01726577 100644
--- a/components/drivers/sdio/mmc.c
+++ b/components/drivers/sdio/mmc.c
@@ -294,11 +294,6 @@ static int mmc_select_bus_width(struct rt_mmcsd_card *card, rt_uint8_t *ext_csd)
EXT_CSD_BUS_WIDTH_4,
EXT_CSD_BUS_WIDTH_1
};
- rt_uint32_t bus_widths[] = {
- MMCSD_BUS_WIDTH_8,
- MMCSD_BUS_WIDTH_4,
- MMCSD_BUS_WIDTH_1
- };
struct rt_mmcsd_host *host = card->host;
unsigned idx, trys, bus_width = 0;
int err = 0;
@@ -312,7 +307,7 @@ static int mmc_select_bus_width(struct rt_mmcsd_card *card, rt_uint8_t *ext_csd)
* the supported bus width or compare the ext csd values of current
* bus width and ext csd values of 1 bit mode read earlier.
*/
- for (idx = 0; idx < sizeof(bus_widths)/sizeof(rt_uint32_t); idx++) {
+ for (idx = 0; idx < sizeof(ext_csd_bits)/sizeof(rt_uint32_t); idx++) {
/*
* Host is capable of 8bit transfer, then switch
* the device to work in 8bit transfer mode. If the