[error code][-RT_EIO] fix that use RT_EIO without -

This commit is contained in:
Meco Man 2023-03-16 13:12:51 -04:00 committed by Man, Jianting (Meco)
parent 334c609c6c
commit 2cc9bd876e
57 changed files with 87 additions and 87 deletions

View File

@ -89,7 +89,7 @@ static rt_err_t spi_configure(struct rt_spi_device *device,
}
else
{
return RT_EIO;
return -RT_EIO;
}
uint32_t max_hz;

View File

@ -43,7 +43,7 @@ static rt_err_t configure(struct rt_spi_device* device, struct rt_spi_configurat
if(configuration->data_width > 8)
{
return RT_EIO;
return -RT_EIO;
}
{
@ -107,7 +107,7 @@ static rt_err_t configure(struct rt_spi_device* device, struct rt_spi_configurat
if(!(configuration->mode & RT_SPI_MSB))
{
return RT_EIO;
return -RT_EIO;
}
spi_init_struct.Mode = SPI_MODE_MASTER;

View File

@ -109,7 +109,7 @@ static rt_err_t air32_spi_configure(struct rt_spi_device *device, struct rt_spi_
}
else
{
return RT_EIO;
return -RT_EIO;
}
if (configuration->max_hz >= spi_clock / 2)

View File

@ -39,7 +39,7 @@ static rt_err_t wdg_control(rt_watchdog_t *wdt, int cmd, void *arg)
else
{
LOG_E("arg is NULL!");
return RT_EIO;
return -RT_EIO;
}
break;
case RT_DEVICE_CTRL_WDT_GET_TIMEOUT:
@ -50,7 +50,7 @@ static rt_err_t wdg_control(rt_watchdog_t *wdt, int cmd, void *arg)
else
{
LOG_E("arg is NULL!");
return RT_EIO;
return -RT_EIO;
}
break;
case RT_DEVICE_CTRL_WDT_GET_TIMELEFT:
@ -63,7 +63,7 @@ static rt_err_t wdg_control(rt_watchdog_t *wdt, int cmd, void *arg)
{
LOG_E("arg is NULL!");
}
return RT_EIO;
return -RT_EIO;
case RT_DEVICE_CTRL_WDT_KEEPALIVE:
hal_watchdog_feed();
break;
@ -74,7 +74,7 @@ static rt_err_t wdg_control(rt_watchdog_t *wdt, int cmd, void *arg)
hal_watchdog_stop(wdg_timeout);
break;
default:
return RT_EIO;
return -RT_EIO;
}
return RT_EOK;
}

View File

@ -452,7 +452,7 @@ static rt_err_t configure(struct rt_spi_device *device,
if (configuration->data_width != 8)
{
LOG_D("error: data_width is %d", configuration->data_width);
return RT_EIO;
return -RT_EIO;
}
LOG_D("%s -> %d", __FUNCTION__, __LINE__);

View File

@ -139,7 +139,7 @@ static rt_err_t apm32_spi_configure(struct rt_spi_device *device, struct rt_spi_
}
else
{
return RT_EIO;
return -RT_EIO;
}
#if defined(SOC_SERIES_APM32F0)

View File

@ -137,7 +137,7 @@ static rt_err_t configure(struct rt_spi_device* device,
}
else
{
return RT_EIO;
return -RT_EIO;
}
/* baudrate */

View File

@ -134,7 +134,7 @@ static rt_err_t spi_configure(struct rt_spi_device* device,
}
else
{
return RT_EIO;
return -RT_EIO;
}
/* baudrate */

View File

@ -125,7 +125,7 @@ static rt_err_t spi_configure(struct rt_spi_device* device,
}
else
{
return RT_EIO;
return -RT_EIO;
}
/* baudrate */

View File

@ -56,7 +56,7 @@ static rt_err_t configure(struct rt_spi_device* device, struct rt_spi_configurat
}
else
{
return RT_EIO;
return -RT_EIO;
}
{

View File

@ -56,7 +56,7 @@ static rt_err_t configure(struct rt_spi_device* device, struct rt_spi_configurat
}
else
{
return RT_EIO;
return -RT_EIO;
}
{

View File

@ -57,7 +57,7 @@ static rt_err_t configure(struct rt_spi_device* device, struct rt_spi_configurat
}
else
{
return RT_EIO;
return -RT_EIO;
}
{

View File

@ -66,7 +66,7 @@ static rt_err_t configure(struct rt_spi_device* device,
}
else
{
return RT_EIO;
return -RT_EIO;
}
/* baudrate */

View File

@ -57,7 +57,7 @@ static rt_err_t configure(struct rt_spi_device* device, struct rt_spi_configurat
}
else
{
return RT_EIO;
return -RT_EIO;
}
{

View File

@ -212,7 +212,7 @@ static rt_err_t hc32_spi_init(struct hc32_spi *spi_drv, struct rt_spi_configurat
}
else
{
return RT_EIO;
return -RT_EIO;
}
/* Get BUS clock */
CLK_GetClockFreq(&stcClkFreq);
@ -258,7 +258,7 @@ static rt_err_t hc32_spi_init(struct hc32_spi *spi_drv, struct rt_spi_configurat
rt_hw_spi_board_init(spi_instance);
if (LL_OK != SPI_Init(spi_instance, &stcSpiInit))
{
return RT_EIO;
return -RT_EIO;
}
/* DMA configuration */
@ -296,7 +296,7 @@ static rt_err_t hc32_spi_init(struct hc32_spi *spi_drv, struct rt_spi_configurat
/* Init Dma */
if (LL_OK != DMA_Init(spi_dma->Instance, spi_dma->channel, &stcDmaInit))
{
return RT_EIO;
return -RT_EIO;
}
NVIC_EnableIRQ(spi_dma->irq_config.irq_num);
/* Enable Dma */
@ -335,7 +335,7 @@ static rt_err_t hc32_spi_init(struct hc32_spi *spi_drv, struct rt_spi_configurat
/* Init Dma */
if (LL_OK != DMA_Init(spi_dma->Instance, spi_dma->channel, &stcDmaInit))
{
return RT_EIO;
return -RT_EIO;
}
NVIC_EnableIRQ(spi_dma->irq_config.irq_num);
/* Enable Dma */

View File

@ -103,7 +103,7 @@ static rt_err_t configure(struct rt_spi_device *device,
}
else
{
return RT_EIO;
return -RT_EIO;
}
/* baudrate */

View File

@ -41,12 +41,12 @@ static rt_err_t configure(struct rt_spi_device* device, struct rt_spi_configurat
#if defined(SOC_N32G45X) || defined(SOC_N32WB452) || defined(SOC_N32G4FR)
if (spi_periph != SPI1 && spi_periph != SPI2 && spi_periph != SPI3)
{
return RT_EIO;
return -RT_EIO;
}
#elif defined(SOC_N32L43X) || defined(SOC_N32L40X) || defined(SOC_N32G43X)
if (spi_periph != SPI1 && spi_periph != SPI2)
{
return RT_EIO;
return -RT_EIO;
}
#endif
@ -60,7 +60,7 @@ static rt_err_t configure(struct rt_spi_device* device, struct rt_spi_configurat
}
else
{
return RT_EIO;
return -RT_EIO;
}
{

View File

@ -129,7 +129,7 @@ static rt_err_t n32_spi_init(struct n32_spi *spi_drv, struct rt_spi_configuratio
}
else
{
return RT_EIO;
return -RT_EIO;
}
if (cfg->mode & RT_SPI_CPHA)
@ -238,7 +238,7 @@ static rt_err_t spi_configure(struct rt_spi_device *device,
return n32_spi_init(spi_drv, configuration);
}
static int _spi_recv(SPI_Module *hspi,
static rt_ssize_t _spi_recv(SPI_Module *hspi,
uint8_t *tx_buff,
uint8_t *rx_buff,
uint32_t length,
@ -250,7 +250,7 @@ static int _spi_recv(SPI_Module *hspi,
if ((tx_buff == RT_NULL) && (rx_buff == RT_NULL) || (length == 0))
{
return RT_EIO;
return -RT_EIO;
}
while (length--)
@ -281,12 +281,12 @@ static int _spi_recv(SPI_Module *hspi,
return RT_EOK;
}
static rt_uint32_t spixfer(struct rt_spi_device *device, struct rt_spi_message *message)
static rt_ssize_t spixfer(struct rt_spi_device *device, struct rt_spi_message *message)
{
rt_size_t send_length;
rt_uint8_t *recv_buf;
const rt_uint8_t *send_buf;
rt_err_t stat = RT_EOK;
rt_ssize_t stat = RT_EOK;
/* Check Direction parameter */
RT_ASSERT(device != RT_NULL);
@ -318,7 +318,7 @@ static rt_uint32_t spixfer(struct rt_spi_device *device, struct rt_spi_message *
if (message->send_buf && message->recv_buf)
{
LOG_D("%s:%d", __FUNCTION__, __LINE__);
stat = RT_EIO;
stat = -RT_EIO;
}
else if (message->send_buf)
{

View File

@ -101,7 +101,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device,
u32SPIMode = SPI_MODE_3;
break;
default:
ret = RT_EIO;
ret = -RT_EIO;
goto exit_nu_qspi_bus_configure;
}

View File

@ -120,7 +120,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device,
u32SPIMode = SPI_MODE_3;
break;
default:
ret = RT_EIO;
ret = -RT_EIO;
goto exit_nu_spi_bus_configure;
}

View File

@ -160,7 +160,7 @@ static rt_err_t nu_uspi_bus_configure(struct rt_spi_device *device,
u32SPIMode = USPI_MODE_3;
break;
default:
ret = RT_EIO;
ret = -RT_EIO;
goto exit_nu_uspi_bus_configure;
}

View File

@ -101,7 +101,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device,
u32SPIMode = SPI_MODE_3;
break;
default:
ret = RT_EIO;
ret = -RT_EIO;
goto exit_nu_qspi_bus_configure;
}

View File

@ -180,7 +180,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device,
u32SPIMode = SPI_MODE_3;
break;
default:
ret = RT_EIO;
ret = -RT_EIO;
goto exit_nu_spi_bus_configure;
}

View File

@ -156,14 +156,14 @@ static rt_err_t nu_reset_port(rt_uint8_t port)
if (port > NU_MAX_USBH_PORT)
{
RT_DEBUG_LOG(RT_DEBUG_USB, ("%s ERROR: port index over NU_MAX_USBH_PORT\n", __func__));
return RT_EIO;
return -RT_EIO;
}
psPortCtrl = &s_sUSBHDev.asPortCtrl[port - 1];
if (psPortCtrl->sRHPortDev.pUDev == NULL)
{
RT_DEBUG_LOG(RT_DEBUG_USB, ("%s ERROR: udev not found\n", __func__));
return RT_EIO;
return -RT_EIO;
}
usbh_reset_port(psPortCtrl->sRHPortDev.pUDev);
@ -334,7 +334,7 @@ static rt_err_t nu_close_pipe(upipe_t pipe)
psPortCtrl = GetRHPortControlFromPipe(pipe);
if (psPortCtrl == RT_NULL)
{
return RT_EIO;
return -RT_EIO;
}
psPortDev = GetPortDevFromPipe(pipe);

View File

@ -160,7 +160,7 @@ static rt_err_t nu_uspi_bus_configure(struct rt_spi_device *device,
u32SPIMode = USPI_MODE_3;
break;
default:
ret = RT_EIO;
ret = -RT_EIO;
goto exit_nu_uspi_bus_configure;
}

View File

@ -119,7 +119,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device,
u32SPIMode = SPI_MODE_3;
break;
default:
ret = RT_EIO;
ret = -RT_EIO;
goto exit_nu_qspi_bus_configure;
}

View File

@ -324,7 +324,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device,
u32SPIMode = SPI_MODE_3;
break;
default:
ret = RT_EIO;
ret = -RT_EIO;
goto exit_nu_spi_bus_configure;
}

View File

@ -158,14 +158,14 @@ static rt_err_t nu_reset_port(rt_uint8_t port)
if (port > NU_MAX_USBH_PORT)
{
RT_DEBUG_LOG(RT_DEBUG_USB, ("%s ERROR: port index over NU_MAX_USBH_PORT\n", __func__));
return RT_EIO;
return -RT_EIO;
}
psPortCtrl = &s_sUSBHDev.asPortCtrl[port - 1];
if (psPortCtrl->sRHPortDev.pUDev == NULL)
{
RT_DEBUG_LOG(RT_DEBUG_USB, ("%s ERROR: udev not found\n", __func__));
return RT_EIO;
return -RT_EIO;
}
usbh_reset_port(psPortCtrl->sRHPortDev.pUDev);
@ -336,7 +336,7 @@ static rt_err_t nu_close_pipe(upipe_t pipe)
psPortCtrl = GetRHPortControlFromPipe(pipe);
if (psPortCtrl == RT_NULL)
{
return RT_EIO;
return -RT_EIO;
}
psPortDev = GetPortDevFromPipe(pipe);

View File

@ -139,7 +139,7 @@ static rt_err_t nu_uspi_bus_configure(struct rt_spi_device *device,
u32SPIMode = USPI_MODE_3;
break;
default:
ret = RT_EIO;
ret = -RT_EIO;
goto exit_nu_uspi_bus_configure;
}

View File

@ -120,7 +120,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device,
u32SPIMode = SPI_MODE_3;
break;
default:
ret = RT_EIO;
ret = -RT_EIO;
goto exit_nu_qspi_bus_configure;
}

View File

@ -180,7 +180,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device,
u32SPIMode = SPI_MODE_3;
break;
default:
ret = RT_EIO;
ret = -RT_EIO;
goto exit_nu_spi_bus_configure;
}

View File

@ -158,14 +158,14 @@ static rt_err_t nu_reset_port(rt_uint8_t port)
if (port > NU_MAX_USBH_PORT)
{
RT_DEBUG_LOG(RT_DEBUG_USB, ("%s ERROR: port index over NU_MAX_USBH_PORT\n", __func__));
return RT_EIO;
return -RT_EIO;
}
psPortCtrl = &s_sUSBHDev.asPortCtrl[port - 1];
if (psPortCtrl->sRHPortDev.pUDev == NULL)
{
RT_DEBUG_LOG(RT_DEBUG_USB, ("%s ERROR: udev not found\n", __func__));
return RT_EIO;
return -RT_EIO;
}
usbh_reset_port(psPortCtrl->sRHPortDev.pUDev);
@ -336,7 +336,7 @@ static rt_err_t nu_close_pipe(upipe_t pipe)
psPortCtrl = GetRHPortControlFromPipe(pipe);
if (psPortCtrl == RT_NULL)
{
return RT_EIO;
return -RT_EIO;
}
psPortDev = GetPortDevFromPipe(pipe);

View File

@ -160,7 +160,7 @@ static rt_err_t nu_uspi_bus_configure(struct rt_spi_device *device,
u32SPIMode = USPI_MODE_3;
break;
default:
ret = RT_EIO;
ret = -RT_EIO;
goto exit_nu_uspi_bus_configure;
}

View File

@ -118,7 +118,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device,
u32SPIMode = SPI_MODE_3;
break;
default:
ret = RT_EIO;
ret = -RT_EIO;
goto exit_nu_qspi_bus_configure;
}

View File

@ -175,7 +175,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device,
u32SPIMode = SPI_MODE_3;
break;
default:
ret = RT_EIO;
ret = -RT_EIO;
goto exit_nu_spi_bus_configure;
}

View File

@ -162,14 +162,14 @@ static rt_err_t nu_reset_port(rt_uint8_t port)
if (port > NU_MAX_USBH_PORT)
{
RT_DEBUG_LOG(RT_DEBUG_USB, ("%s ERROR: port index over NU_MAX_USBH_PORT\n", __func__));
return RT_EIO;
return -RT_EIO;
}
psPortCtrl = &s_sUSBHDev.asPortCtrl[port - 1];
if (psPortCtrl->sRHPortDev.pUDev == NULL)
{
RT_DEBUG_LOG(RT_DEBUG_USB, ("%s ERROR: udev not found\n", __func__));
return RT_EIO;
return -RT_EIO;
}
usbh_reset_port(psPortCtrl->sRHPortDev.pUDev);
@ -345,7 +345,7 @@ static rt_err_t nu_close_pipe(upipe_t pipe)
psPortCtrl = GetRHPortControlFromPipe(pipe);
if (psPortCtrl == RT_NULL)
{
return RT_EIO;
return -RT_EIO;
}
psPortDev = GetPortDevFromPipe(pipe);

View File

@ -127,7 +127,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device,
u32SPIMode = SPI_MODE_3;
break;
default:
ret = RT_EIO;
ret = -RT_EIO;
goto exit_nu_qspi_bus_configure;
}

View File

@ -170,14 +170,14 @@ static rt_err_t nu_reset_port(rt_uint8_t port)
if (port > NU_MAX_USBH_PORT)
{
RT_DEBUG_LOG(RT_DEBUG_USB, ("%s ERROR: port index over NU_MAX_USBH_PORT\n", __func__));
return RT_EIO;
return -RT_EIO;
}
psPortCtrl = &s_sUSBHDev.asPortCtrl[port - 1];
if (psPortCtrl->sRHPortDev.pUDev == NULL)
{
RT_DEBUG_LOG(RT_DEBUG_USB, ("%s ERROR: udev not found\n", __func__));
return RT_EIO;
return -RT_EIO;
}
usbh_reset_port(psPortCtrl->sRHPortDev.pUDev);
@ -364,7 +364,7 @@ static rt_err_t nu_close_pipe(upipe_t pipe)
psPortCtrl = GetRHPortControlFromPipe(pipe);
if (psPortCtrl == RT_NULL)
{
return RT_EIO;
return -RT_EIO;
}
psPortDev = GetPortDevFromPipe(pipe);

View File

@ -392,7 +392,7 @@ static rt_err_t spinand_status_register_write(struct rt_qspi_device *qspi, uint8
if (spinand_isbusy(qspi))
{
result = RT_EIO;
result = -RT_EIO;
goto exit_spinand_status_register_write;
}
@ -690,7 +690,7 @@ static rt_err_t spinand_reset(struct rt_qspi_device *qspi)
if (spinand_isbusy(qspi))
{
result = RT_EIO;
result = -RT_EIO;
goto exit_spinand_reset;
}

View File

@ -101,7 +101,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device,
u32SPIMode = SPI_MODE_3;
break;
default:
ret = RT_EIO;
ret = -RT_EIO;
goto exit_nu_qspi_bus_configure;
}

View File

@ -145,7 +145,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device,
u32SPIMode = SPI_MODE_3;
break;
default:
ret = RT_EIO;
ret = -RT_EIO;
goto exit_nu_spi_bus_configure;
}

View File

@ -170,14 +170,14 @@ static rt_err_t nu_reset_port(rt_uint8_t port)
if (port > NU_MAX_USBH_PORT)
{
RT_DEBUG_LOG(RT_DEBUG_USB, ("%s ERROR: port index over NU_MAX_USBH_PORT\n", __func__));
return RT_EIO;
return -RT_EIO;
}
psPortCtrl = &s_sUSBHDev.asPortCtrl[port - 1];
if (psPortCtrl->sRHPortDev.pUDev == NULL)
{
RT_DEBUG_LOG(RT_DEBUG_USB, ("%s ERROR: udev not found\n", __func__));
return RT_EIO;
return -RT_EIO;
}
usbh_reset_port(psPortCtrl->sRHPortDev.pUDev);
@ -364,7 +364,7 @@ static rt_err_t nu_close_pipe(upipe_t pipe)
psPortCtrl = GetRHPortControlFromPipe(pipe);
if (psPortCtrl == RT_NULL)
{
return RT_EIO;
return -RT_EIO;
}
psPortDev = GetPortDevFromPipe(pipe);

View File

@ -93,7 +93,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;
}

View File

@ -94,7 +94,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;
}

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;
}

View File

@ -102,7 +102,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;

View File

@ -452,7 +452,7 @@ static rt_err_t vega_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_
if(irq_map->irq_info.pin != pin)
{
return RT_EIO;
return -RT_EIO;
}
irq_map->enable = PIN_IRQ_ENABLE;

View File

@ -117,7 +117,7 @@ static rt_err_t stm32_spi_init(struct stm32_spi *spi_drv, struct rt_spi_configur
}
else
{
return RT_EIO;
return -RT_EIO;
}
if (cfg->mode & RT_SPI_CPHA)
@ -240,7 +240,7 @@ static rt_err_t stm32_spi_init(struct stm32_spi *spi_drv, struct rt_spi_configur
if (HAL_SPI_Init(spi_handle) != HAL_OK)
{
return RT_EIO;
return -RT_EIO;
}
#if defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F0) \

View File

@ -180,7 +180,7 @@ static rt_err_t _read_id(struct rt_mtd_nand_device *device)
return RT_EOK;
}
static rt_uint8_t rt_hw_nand_ecc_check(rt_uint32_t generatedEcc, rt_uint32_t readEcc, rt_uint8_t* data)
static rt_err_t rt_hw_nand_ecc_check(rt_uint32_t generatedEcc, rt_uint32_t readEcc, rt_uint8_t* data)
{
#define ECC_MASK28 0x0FFFFFFF /* 28 valid ECC parity bits. */
#define ECC_MASK 0x05555555 /* 14 ECC parity bits. */
@ -235,9 +235,9 @@ static rt_uint8_t rt_hw_nand_ecc_check(rt_uint32_t generatedEcc, rt_uint32_t rea
}
if (count == 1) /* Error in the ECC itself. */
return RT_EIO;
return -RT_EIO;
return RT_EIO; /* Unable to correct data. */
return -RT_EIO; /* Unable to correct data. */
#undef ECC_MASK
#undef ECC_MASK24

View File

@ -129,7 +129,7 @@ static rt_err_t swm_spi_configure(struct rt_spi_device *device,
}
else
{
return RT_EIO;
return -RT_EIO;
}
if (configure->mode & RT_SPI_CPHA)

View File

@ -131,7 +131,7 @@ static rt_err_t swm_spi_configure(struct rt_spi_device *device,
}
else
{
return RT_EIO;
return -RT_EIO;
}
if (configure->mode & RT_SPI_CPHA)

View File

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

View File

@ -111,7 +111,7 @@ static rt_err_t ch32f1_spi_configure(struct rt_spi_device *device, struct rt_spi
}
else
{
return RT_EIO;
return -RT_EIO;
}
if (configuration->max_hz >= spi_clock / 2)

View File

@ -116,7 +116,7 @@ static rt_err_t ch32f2_spi_configure(struct rt_spi_device *device, struct rt_spi
}
else
{
return RT_EIO;
return -RT_EIO;
}
if (configuration->max_hz >= spi_clock / 2)

View File

@ -262,7 +262,7 @@ static rt_err_t ch32_spi_init(struct ch32_spi *spi_drv, struct rt_spi_configurat
}
else
{
return RT_EIO;
return -RT_EIO;
}
if (cfg->mode & RT_SPI_CPHA)

View File

@ -804,7 +804,7 @@ rt_err_t enc28j60_attach(const char *spi_device_name)
NET_DEBUG("phy_rev:%02X\r\n", enc28j60_dev.phy_rev);
NET_DEBUG("phy_pn:%02X\r\n", enc28j60_dev.phy_pn);
NET_DEBUG("phy_id:%08X\r\n", enc28j60_dev.phy_id);
return RT_EIO;
return -RT_EIO;
}
}

View File

@ -468,7 +468,7 @@ static rt_err_t rt_msd_init(rt_device_t dev)
if (msd->spi_device == RT_NULL)
{
MSD_DEBUG("[err] the SPI SD device has no SPI!\r\n");
return RT_EIO;
return -RT_EIO;
}
/* config spi */