[bsp] Modify the RT_Exxx error return value to a negative number

This commit is contained in:
褚仕成 2023-03-30 17:59:26 +08:00 committed by Man, Jianting (Meco)
parent 4aa38e3d86
commit 0cdf72f753
5 changed files with 6 additions and 6 deletions

View File

@ -127,7 +127,7 @@ static rt_uint8_t mm32_adc_get_resolution(struct rt_adc_device *device)
static rt_int16_t mm32_adc_get_vref(struct rt_adc_device *device)
{
if(device == RT_NULL)
return RT_ERROR;
return -RT_ERROR;
return 3300;
}

View File

@ -574,7 +574,7 @@ static rt_err_t bcmgenet_eth_init(rt_device_t device)
major = 1;
rt_kprintf("Uns upported GENETv%d.%d\n", major, (hw_reg >> 16) & 0x0f);
return RT_ERROR;
return -RT_ERROR;
}
/* set interface */
ret = bcmgenet_interface_set();

View File

@ -437,7 +437,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.
@ -471,7 +471,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);

View File

@ -185,7 +185,7 @@ static rt_uint32_t raspi_spi_xfer(struct rt_spi_device *device, struct rt_spi_me
(config.mode & RT_SPI_CS_HIGH)?prev_raspi_pin_write(cs_pin, 0):prev_raspi_pin_write(cs_pin, 1);
}
if (res != RT_EOK)
return RT_ERROR;
return -RT_ERROR;
return message->length;
}

View File

@ -95,7 +95,7 @@ static rt_err_t raspi_wdg_control(rt_watchdog_t *wdt, int cmd, void *arg)
raspi_watchdog_stop();
break;
default:
return RT_EIO;
return -RT_EIO;
}
return RT_EOK;
}