summaryrefslogtreecommitdiff
path: root/components/drivers
diff options
context:
space:
mode:
authorgeniusgogo <[email protected]>2023-08-24 10:58:25 +0800
committerGitHub <[email protected]>2023-08-23 22:58:25 -0400
commitd55066e10d9b7e1bab272d9df3a1ff120e17a62e (patch)
treeb09d87ffb0dea0d2f4c0f6e10690afa33b875cc1 /components/drivers
parentb4dac34167e2afaf8d9ec66fd0d493c1a155d9d0 (diff)
cleanup: fix building warnings
Diffstat (limited to 'components/drivers')
-rw-r--r--components/drivers/sdio/sd.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/components/drivers/sdio/sd.c b/components/drivers/sdio/sd.c
index 626dcadba0..cebb86ee43 100644
--- a/components/drivers/sdio/sd.c
+++ b/components/drivers/sdio/sd.c
@@ -534,21 +534,21 @@ static rt_int32_t mmcsd_sd_init_card(struct rt_mmcsd_host *host,
err = mmcsd_send_app_op_cond(host, ocr, RT_NULL);
if (err)
- goto err;
+ goto err2;
if (controller_is_spi(host))
err = mmcsd_get_cid(host, resp);
else
err = mmcsd_all_get_cid(host, resp);
if (err)
- goto err;
+ goto err2;
card = rt_malloc(sizeof(struct rt_mmcsd_card));
if (!card)
{
LOG_E("malloc card failed!");
err = -RT_ENOMEM;
- goto err;
+ goto err2;
}
rt_memset(card, 0, sizeof(struct rt_mmcsd_card));
@@ -635,7 +635,7 @@ static rt_int32_t mmcsd_sd_init_card(struct rt_mmcsd_host *host,
err1:
rt_free(card);
-err:
+err2:
return err;
}
@@ -645,7 +645,7 @@ err:
*/
rt_int32_t init_sd(struct rt_mmcsd_host *host, rt_uint32_t ocr)
{
- rt_int32_t err;
+ rt_int32_t err = -RT_EINVAL;
rt_uint32_t current_ocr;
/*
* We need to get OCR a different way for SPI.
@@ -656,7 +656,7 @@ rt_int32_t init_sd(struct rt_mmcsd_host *host, rt_uint32_t ocr)
err = mmcsd_spi_read_ocr(host, 0, &ocr);
if (err)
- goto err;
+ goto _err;
}
if (ocr & VDD_165_195)
@@ -675,7 +675,7 @@ rt_int32_t init_sd(struct rt_mmcsd_host *host, rt_uint32_t ocr)
if (!current_ocr)
{
err = -RT_ERROR;
- goto err;
+ goto _err;
}
/*
@@ -683,7 +683,7 @@ rt_int32_t init_sd(struct rt_mmcsd_host *host, rt_uint32_t ocr)
*/
err = mmcsd_sd_init_card(host, current_ocr);
if (err)
- goto err;
+ goto _err;
mmcsd_host_unlock(host);
@@ -699,7 +699,7 @@ remove_card:
rt_mmcsd_blk_remove(host->card);
rt_free(host->card);
host->card = RT_NULL;
-err:
+_err:
LOG_D("init SD card failed!");