From: Gabriel Somlo Date: Mon, 15 Jun 2020 19:31:37 +0000 (-0400) Subject: liblitesdcard/sdcard: streamline initialization (cosmetic) X-Git-Tag: 24jan2021_ls180~176^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5d9d99c0c282c2976a623651652b193b327c0f04;p=litex.git liblitesdcard/sdcard: streamline initialization (cosmetic) Also, s/spisdcardstatus/sdcardstatus/g (this is *not* the SPI version). --- diff --git a/litex/soc/software/liblitesdcard/sdcard.c b/litex/soc/software/liblitesdcard/sdcard.c index 92edf8e6..f3108f8a 100644 --- a/litex/soc/software/liblitesdcard/sdcard.c +++ b/litex/soc/software/liblitesdcard/sdcard.c @@ -719,22 +719,17 @@ int sdcard_test(unsigned int blocks) /* SDCard FatFs disk functions */ /*-----------------------------------------------------------------------*/ -static DSTATUS spisdcardstatus = STA_NOINIT; +static DSTATUS sdcardstatus = STA_NOINIT; DSTATUS disk_status(uint8_t drv) { if (drv) return STA_NOINIT; - return spisdcardstatus; + return sdcardstatus; } DSTATUS disk_initialize(uint8_t drv) { - uint8_t r; - - if (drv) return RES_NOTRDY; - - r = sdcard_init(); - - spisdcardstatus = r ? 0 : STA_NOINIT; - return spisdcardstatus; + if (drv) return STA_NOINIT; + sdcardstatus = sdcard_init() ? 0 : STA_NOINIT; + return sdcardstatus; } DRESULT disk_read(uint8_t drv, uint8_t *buf, uint32_t sector, uint32_t count) {