[errno code][-RT_ERROR] fix that use RT_ERROR without -

This commit is contained in:
Meco Man
2023-03-17 00:12:16 -04:00
committed by Man, Jianting (Meco)
parent de963feef4
commit 0f461e870c
272 changed files with 639 additions and 644 deletions

View File

@@ -407,7 +407,7 @@ static rt_err_t sdhci_setclock(struct sdhci_t * sdhci, rt_uint32_t clock)
if (count <= 0)
{
rt_kprintf("EMMC: Set clock: timeout waiting for inhibit flags. Status %08x.\n",read32(pdat->virt + EMMC_STATUS));
return RT_ERROR;
return -RT_ERROR;
}
// Switch clock off.
@@ -436,7 +436,7 @@ static rt_err_t sdhci_setclock(struct sdhci_t * sdhci, rt_uint32_t clock)
if (count <= 0)
{
rt_kprintf("EMMC: ERROR: failed to get stable clock %d.\n", clock);
return RT_ERROR;
return -RT_ERROR;
}
mmcsd_dbg("set stable clock %d.\n", clock);
return RT_EOK;
@@ -486,7 +486,7 @@ static rt_err_t reset_emmc(struct sdhci_pdata_t * pdat){
if (cnt <= 0)
{
rt_kprintf("ERROR: failed to reset EMMC\n");
return RT_ERROR;
return -RT_ERROR;
}
temp = read32((pdat->virt + EMMC_CONTROL1));
temp |= C1_CLK_INTLEN | C1_TOUNIT_MAX;

View File

@@ -131,7 +131,7 @@ static rt_err_t spi_transfernb(rt_uint8_t* tbuf, rt_uint8_t* rbuf, rt_uint32_t l
return RT_EOK;
}
static rt_uint32_t raspi_spi_xfer(struct rt_spi_device *device, struct rt_spi_message *message)
static rt_ssize_t raspi_spi_xfer(struct rt_spi_device *device, struct rt_spi_message *message)
{
RT_ASSERT(device != RT_NULL);
@@ -163,7 +163,7 @@ static rt_uint32_t raspi_spi_xfer(struct rt_spi_device *device, struct rt_spi_me
spi_gpio_write(cs_pin, 1);
if (res != RT_EOK)
return RT_ERROR;
return res;
return message->length;
}