From 2cc9bd876e0c52e4ffd52ff5769f81020389c486 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Thu, 16 Mar 2023 13:12:51 -0400 Subject: [PATCH] [error code][-RT_EIO] fix that use RT_EIO without - --- bsp/Infineon/libraries/HAL_Drivers/drv_spi.c | 2 +- bsp/Vango/v85xx/drivers/drv_spi.c | 4 ++-- bsp/airm2m/air32f103/libraries/rt_drivers/drv_spi.c | 2 +- bsp/allwinner/libraries/drivers/drv_wdt.c | 8 ++++---- bsp/allwinner_tina/drivers/spi/drv_spi.c | 2 +- bsp/apm32/libraries/Drivers/drv_spi.c | 2 +- bsp/at32/libraries/rt_drivers/drv_spi.c | 2 +- bsp/gd32/arm/libraries/gd32_drivers/drv_spi.c | 2 +- bsp/gd32/risc-v/libraries/gd32_drivers/drv_spi.c | 2 +- bsp/gd32105c-eval/drivers/drv_spi.c | 2 +- bsp/gd32107c-eval/drivers/drv_spi.c | 2 +- bsp/gd32303e-eval/drivers/drv_spi.c | 2 +- bsp/gd32450z-eval/drivers/drv_spi.c | 2 +- bsp/gd32e230k-start/drivers/drv_spi.c | 2 +- bsp/hc32/libraries/hc32_drivers/drv_spi.c | 8 ++++---- bsp/hk32/libraries/rt_drivers/drv_spi.c | 2 +- bsp/n32/libraries/n32_drivers/drv_spi.c | 6 +++--- bsp/n32g452xx/Libraries/rt_drivers/drv_spi.c | 12 ++++++------ bsp/nuvoton/libraries/m031/rtt_port/drv_qspi.c | 2 +- bsp/nuvoton/libraries/m031/rtt_port/drv_spi.c | 2 +- bsp/nuvoton/libraries/m031/rtt_port/drv_uspi.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_qspi.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_usbhost.c | 6 +++--- bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c | 2 +- bsp/nuvoton/libraries/m460/rtt_port/drv_qspi.c | 2 +- bsp/nuvoton/libraries/m460/rtt_port/drv_spi.c | 2 +- bsp/nuvoton/libraries/m460/rtt_port/drv_usbhost.c | 6 +++--- bsp/nuvoton/libraries/m460/rtt_port/drv_uspi.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_qspi.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_spi.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_usbhost.c | 6 +++--- bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c | 2 +- bsp/nuvoton/libraries/ma35/rtt_port/drv_qspi.c | 2 +- bsp/nuvoton/libraries/ma35/rtt_port/drv_spi.c | 2 +- bsp/nuvoton/libraries/ma35/rtt_port/drv_usbhost.c | 6 +++--- bsp/nuvoton/libraries/n9h30/rtt_port/drv_qspi.c | 2 +- bsp/nuvoton/libraries/n9h30/rtt_port/drv_usbhost.c | 6 +++--- bsp/nuvoton/libraries/nu_packages/SPINAND/spinand.c | 4 ++-- bsp/nuvoton/libraries/nuc980/rtt_port/drv_qspi.c | 2 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.c | 2 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbhost.c | 6 +++--- bsp/raspberry-pi/raspi3-32/driver/drv_wdt.c | 2 +- bsp/raspberry-pi/raspi3-64/driver/drv_wdt.c | 2 +- bsp/raspberry-pi/raspi4-32/driver/drv_wdt.c | 2 +- bsp/raspberry-pi/raspi4-64/driver/drv_wdt.c | 2 +- bsp/rv32m1_vega/ri5cy/driver/drv_gpio.c | 2 +- bsp/stm32/libraries/HAL_Drivers/drv_spi.c | 4 ++-- bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_nand.c | 6 +++--- bsp/synwit/swm320/drivers/drv_spi.c | 2 +- bsp/synwit/swm341/drivers/drv_spi.c | 2 +- bsp/w60x/drivers/drv_wdt.c | 2 +- .../arm/Libraries/ch32_drivers/drv_spi_ch32f10x.c | 2 +- .../arm/Libraries/ch32_drivers/drv_spi_ch32f20x.c | 2 +- bsp/wch/risc-v/Libraries/ch32_drivers/drv_spi.c | 2 +- components/drivers/spi/enc28j60.c | 2 +- components/drivers/spi/spi_msd.c | 2 +- 57 files changed, 87 insertions(+), 87 deletions(-) diff --git a/bsp/Infineon/libraries/HAL_Drivers/drv_spi.c b/bsp/Infineon/libraries/HAL_Drivers/drv_spi.c index 30c6fd9bde..28efc62c49 100644 --- a/bsp/Infineon/libraries/HAL_Drivers/drv_spi.c +++ b/bsp/Infineon/libraries/HAL_Drivers/drv_spi.c @@ -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; diff --git a/bsp/Vango/v85xx/drivers/drv_spi.c b/bsp/Vango/v85xx/drivers/drv_spi.c index 84c77c29a4..7fa11d4455 100644 --- a/bsp/Vango/v85xx/drivers/drv_spi.c +++ b/bsp/Vango/v85xx/drivers/drv_spi.c @@ -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; diff --git a/bsp/airm2m/air32f103/libraries/rt_drivers/drv_spi.c b/bsp/airm2m/air32f103/libraries/rt_drivers/drv_spi.c index ba9a96139a..4b39fa3d14 100644 --- a/bsp/airm2m/air32f103/libraries/rt_drivers/drv_spi.c +++ b/bsp/airm2m/air32f103/libraries/rt_drivers/drv_spi.c @@ -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) diff --git a/bsp/allwinner/libraries/drivers/drv_wdt.c b/bsp/allwinner/libraries/drivers/drv_wdt.c index 6a75add773..abd33099db 100644 --- a/bsp/allwinner/libraries/drivers/drv_wdt.c +++ b/bsp/allwinner/libraries/drivers/drv_wdt.c @@ -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; } diff --git a/bsp/allwinner_tina/drivers/spi/drv_spi.c b/bsp/allwinner_tina/drivers/spi/drv_spi.c index cd1f2aa383..9a0b8d6bff 100644 --- a/bsp/allwinner_tina/drivers/spi/drv_spi.c +++ b/bsp/allwinner_tina/drivers/spi/drv_spi.c @@ -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__); diff --git a/bsp/apm32/libraries/Drivers/drv_spi.c b/bsp/apm32/libraries/Drivers/drv_spi.c index fde1f7f0a0..c806ff159d 100644 --- a/bsp/apm32/libraries/Drivers/drv_spi.c +++ b/bsp/apm32/libraries/Drivers/drv_spi.c @@ -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) diff --git a/bsp/at32/libraries/rt_drivers/drv_spi.c b/bsp/at32/libraries/rt_drivers/drv_spi.c index a2677f324a..7553cf5b4d 100644 --- a/bsp/at32/libraries/rt_drivers/drv_spi.c +++ b/bsp/at32/libraries/rt_drivers/drv_spi.c @@ -137,7 +137,7 @@ static rt_err_t configure(struct rt_spi_device* device, } else { - return RT_EIO; + return -RT_EIO; } /* baudrate */ diff --git a/bsp/gd32/arm/libraries/gd32_drivers/drv_spi.c b/bsp/gd32/arm/libraries/gd32_drivers/drv_spi.c index d317c8c531..a60dba400d 100644 --- a/bsp/gd32/arm/libraries/gd32_drivers/drv_spi.c +++ b/bsp/gd32/arm/libraries/gd32_drivers/drv_spi.c @@ -134,7 +134,7 @@ static rt_err_t spi_configure(struct rt_spi_device* device, } else { - return RT_EIO; + return -RT_EIO; } /* baudrate */ diff --git a/bsp/gd32/risc-v/libraries/gd32_drivers/drv_spi.c b/bsp/gd32/risc-v/libraries/gd32_drivers/drv_spi.c index cbd0fd4b28..416ed78045 100644 --- a/bsp/gd32/risc-v/libraries/gd32_drivers/drv_spi.c +++ b/bsp/gd32/risc-v/libraries/gd32_drivers/drv_spi.c @@ -125,7 +125,7 @@ static rt_err_t spi_configure(struct rt_spi_device* device, } else { - return RT_EIO; + return -RT_EIO; } /* baudrate */ diff --git a/bsp/gd32105c-eval/drivers/drv_spi.c b/bsp/gd32105c-eval/drivers/drv_spi.c index 3f9e86cb41..7c52c37961 100644 --- a/bsp/gd32105c-eval/drivers/drv_spi.c +++ b/bsp/gd32105c-eval/drivers/drv_spi.c @@ -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; } { diff --git a/bsp/gd32107c-eval/drivers/drv_spi.c b/bsp/gd32107c-eval/drivers/drv_spi.c index 3f9e86cb41..7c52c37961 100644 --- a/bsp/gd32107c-eval/drivers/drv_spi.c +++ b/bsp/gd32107c-eval/drivers/drv_spi.c @@ -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; } { diff --git a/bsp/gd32303e-eval/drivers/drv_spi.c b/bsp/gd32303e-eval/drivers/drv_spi.c index 96f53b5019..34e597bad6 100644 --- a/bsp/gd32303e-eval/drivers/drv_spi.c +++ b/bsp/gd32303e-eval/drivers/drv_spi.c @@ -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; } { diff --git a/bsp/gd32450z-eval/drivers/drv_spi.c b/bsp/gd32450z-eval/drivers/drv_spi.c index acd4f7198f..b6bb69c83b 100644 --- a/bsp/gd32450z-eval/drivers/drv_spi.c +++ b/bsp/gd32450z-eval/drivers/drv_spi.c @@ -66,7 +66,7 @@ static rt_err_t configure(struct rt_spi_device* device, } else { - return RT_EIO; + return -RT_EIO; } /* baudrate */ diff --git a/bsp/gd32e230k-start/drivers/drv_spi.c b/bsp/gd32e230k-start/drivers/drv_spi.c index 8efc2a4664..d57ff081c5 100644 --- a/bsp/gd32e230k-start/drivers/drv_spi.c +++ b/bsp/gd32e230k-start/drivers/drv_spi.c @@ -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; } { diff --git a/bsp/hc32/libraries/hc32_drivers/drv_spi.c b/bsp/hc32/libraries/hc32_drivers/drv_spi.c index 8abf1ae4d1..d3a84c3c8c 100644 --- a/bsp/hc32/libraries/hc32_drivers/drv_spi.c +++ b/bsp/hc32/libraries/hc32_drivers/drv_spi.c @@ -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 */ diff --git a/bsp/hk32/libraries/rt_drivers/drv_spi.c b/bsp/hk32/libraries/rt_drivers/drv_spi.c index 18bc7f91fa..41a693d980 100644 --- a/bsp/hk32/libraries/rt_drivers/drv_spi.c +++ b/bsp/hk32/libraries/rt_drivers/drv_spi.c @@ -103,7 +103,7 @@ static rt_err_t configure(struct rt_spi_device *device, } else { - return RT_EIO; + return -RT_EIO; } /* baudrate */ diff --git a/bsp/n32/libraries/n32_drivers/drv_spi.c b/bsp/n32/libraries/n32_drivers/drv_spi.c index 4f0dc99f64..5728b0d06c 100644 --- a/bsp/n32/libraries/n32_drivers/drv_spi.c +++ b/bsp/n32/libraries/n32_drivers/drv_spi.c @@ -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; } { diff --git a/bsp/n32g452xx/Libraries/rt_drivers/drv_spi.c b/bsp/n32g452xx/Libraries/rt_drivers/drv_spi.c index ae6379de00..6f1d0b2ee5 100644 --- a/bsp/n32g452xx/Libraries/rt_drivers/drv_spi.c +++ b/bsp/n32g452xx/Libraries/rt_drivers/drv_spi.c @@ -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) { diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_qspi.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_qspi.c index 1e08f396db..e8726de726 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_qspi.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_qspi.c @@ -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; } diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_spi.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_spi.c index 6e5e38b20b..bc8e1cdcca 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_spi.c @@ -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; } diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_uspi.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_uspi.c index a402013754..a8f726568e 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_uspi.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_uspi.c @@ -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; } diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_qspi.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_qspi.c index bf023aefa6..465be2fe52 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_qspi.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_qspi.c @@ -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; } diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.c index 2353effc5d..0e2d1fcd00 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.c @@ -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; } diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_usbhost.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_usbhost.c index abee7c2a77..b1ae752a3f 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_usbhost.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_usbhost.c @@ -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); diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c index 4b86edae22..0d0e57daf6 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c @@ -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; } diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_qspi.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_qspi.c index 4843a3a6a0..700a143251 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_qspi.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_qspi.c @@ -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; } diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_spi.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_spi.c index 940578dd34..1d05afe9e9 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_spi.c @@ -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; } diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_usbhost.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_usbhost.c index 68c2116882..32793f93e2 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_usbhost.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_usbhost.c @@ -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); diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_uspi.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_uspi.c index 36eaffeead..213c839902 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_uspi.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_uspi.c @@ -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; } diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_qspi.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_qspi.c index b22aeefd20..fe7624b6f4 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_qspi.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_qspi.c @@ -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; } diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_spi.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_spi.c index 246559393b..ce29d62347 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_spi.c @@ -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; } diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_usbhost.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_usbhost.c index cf910fcc7e..38c79f46e3 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_usbhost.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_usbhost.c @@ -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); diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c index 21e133b3e4..f724a0ec20 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c @@ -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; } diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/drv_qspi.c b/bsp/nuvoton/libraries/ma35/rtt_port/drv_qspi.c index 0ae777a6c0..96cc4de799 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/drv_qspi.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/drv_qspi.c @@ -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; } diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/drv_spi.c b/bsp/nuvoton/libraries/ma35/rtt_port/drv_spi.c index 92482cc657..d4ff0621f9 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/drv_spi.c @@ -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; } diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/drv_usbhost.c b/bsp/nuvoton/libraries/ma35/rtt_port/drv_usbhost.c index cc0642c9c8..eecff72f7e 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/drv_usbhost.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/drv_usbhost.c @@ -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); diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_qspi.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_qspi.c index 67bfa8b0f9..9112677834 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_qspi.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_qspi.c @@ -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; } diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_usbhost.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_usbhost.c index bb29de3ea0..cb0e83fb73 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_usbhost.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_usbhost.c @@ -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); diff --git a/bsp/nuvoton/libraries/nu_packages/SPINAND/spinand.c b/bsp/nuvoton/libraries/nu_packages/SPINAND/spinand.c index c761fcbf4d..d9f4628299 100644 --- a/bsp/nuvoton/libraries/nu_packages/SPINAND/spinand.c +++ b/bsp/nuvoton/libraries/nu_packages/SPINAND/spinand.c @@ -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; } diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_qspi.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_qspi.c index 64b5dc874c..39108bbb72 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_qspi.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_qspi.c @@ -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; } diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.c index 6f4dd0e2fb..7c1db7cf85 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.c @@ -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; } diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbhost.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbhost.c index bb29de3ea0..cb0e83fb73 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbhost.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbhost.c @@ -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); diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_wdt.c b/bsp/raspberry-pi/raspi3-32/driver/drv_wdt.c index b748a7b472..0c4885871c 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_wdt.c +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_wdt.c @@ -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; } diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_wdt.c b/bsp/raspberry-pi/raspi3-64/driver/drv_wdt.c index f90a251ad0..ccf8ca6cff 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_wdt.c +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_wdt.c @@ -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; } diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_wdt.c b/bsp/raspberry-pi/raspi4-32/driver/drv_wdt.c index a9b2e8fc0c..1cb3a25b17 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_wdt.c +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_wdt.c @@ -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; } diff --git a/bsp/raspberry-pi/raspi4-64/driver/drv_wdt.c b/bsp/raspberry-pi/raspi4-64/driver/drv_wdt.c index ac7d1addb8..13ef095b03 100644 --- a/bsp/raspberry-pi/raspi4-64/driver/drv_wdt.c +++ b/bsp/raspberry-pi/raspi4-64/driver/drv_wdt.c @@ -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; diff --git a/bsp/rv32m1_vega/ri5cy/driver/drv_gpio.c b/bsp/rv32m1_vega/ri5cy/driver/drv_gpio.c index afc152a96b..ab0822382a 100644 --- a/bsp/rv32m1_vega/ri5cy/driver/drv_gpio.c +++ b/bsp/rv32m1_vega/ri5cy/driver/drv_gpio.c @@ -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; diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_spi.c b/bsp/stm32/libraries/HAL_Drivers/drv_spi.c index f3d5d53401..12afd5624f 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_spi.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_spi.c @@ -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) \ diff --git a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_nand.c b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_nand.c index 40d22e505e..ee968b8f9a 100644 --- a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_nand.c +++ b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_nand.c @@ -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 diff --git a/bsp/synwit/swm320/drivers/drv_spi.c b/bsp/synwit/swm320/drivers/drv_spi.c index b806991af7..64eec472af 100644 --- a/bsp/synwit/swm320/drivers/drv_spi.c +++ b/bsp/synwit/swm320/drivers/drv_spi.c @@ -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) diff --git a/bsp/synwit/swm341/drivers/drv_spi.c b/bsp/synwit/swm341/drivers/drv_spi.c index 205d015a0d..5cff92936e 100644 --- a/bsp/synwit/swm341/drivers/drv_spi.c +++ b/bsp/synwit/swm341/drivers/drv_spi.c @@ -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) diff --git a/bsp/w60x/drivers/drv_wdt.c b/bsp/w60x/drivers/drv_wdt.c index ded572007a..ab92c82cca 100644 --- a/bsp/w60x/drivers/drv_wdt.c +++ b/bsp/w60x/drivers/drv_wdt.c @@ -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; } diff --git a/bsp/wch/arm/Libraries/ch32_drivers/drv_spi_ch32f10x.c b/bsp/wch/arm/Libraries/ch32_drivers/drv_spi_ch32f10x.c index db3ec7dec2..537676591a 100644 --- a/bsp/wch/arm/Libraries/ch32_drivers/drv_spi_ch32f10x.c +++ b/bsp/wch/arm/Libraries/ch32_drivers/drv_spi_ch32f10x.c @@ -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) diff --git a/bsp/wch/arm/Libraries/ch32_drivers/drv_spi_ch32f20x.c b/bsp/wch/arm/Libraries/ch32_drivers/drv_spi_ch32f20x.c index 4d712065b6..5db7b82a65 100644 --- a/bsp/wch/arm/Libraries/ch32_drivers/drv_spi_ch32f20x.c +++ b/bsp/wch/arm/Libraries/ch32_drivers/drv_spi_ch32f20x.c @@ -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) diff --git a/bsp/wch/risc-v/Libraries/ch32_drivers/drv_spi.c b/bsp/wch/risc-v/Libraries/ch32_drivers/drv_spi.c index 89d11a0878..22a078b8f5 100644 --- a/bsp/wch/risc-v/Libraries/ch32_drivers/drv_spi.c +++ b/bsp/wch/risc-v/Libraries/ch32_drivers/drv_spi.c @@ -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) diff --git a/components/drivers/spi/enc28j60.c b/components/drivers/spi/enc28j60.c index f3c3ecb30b..990e9f8acf 100644 --- a/components/drivers/spi/enc28j60.c +++ b/components/drivers/spi/enc28j60.c @@ -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; } } diff --git a/components/drivers/spi/spi_msd.c b/components/drivers/spi/spi_msd.c index dce2a7c8b0..cad7207cd9 100644 --- a/components/drivers/spi/spi_msd.c +++ b/components/drivers/spi/spi_msd.c @@ -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 */