From dfddd79b2453ab13d12b69c7db14e2f685175af7 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Thu, 16 Mar 2023 00:44:05 -0400 Subject: [PATCH] [errno code][-RT_EINVAL] fix that use RT_EINVAL without - --- bsp/Infineon/libraries/HAL_Drivers/drv_pwm.c | 2 +- .../air105/libraries/rt_drivers/drv_spi.c | 2 +- .../libraries/rt_drivers/drv_hwtimer.c | 2 +- bsp/allwinner_tina/drivers/drv_clock.c | 22 +++++++++---------- bsp/allwinner_tina/drivers/drv_gpio.c | 10 ++++----- bsp/allwinner_tina/drivers/drv_gpio.h | 2 +- bsp/apm32/libraries/Drivers/drv_pwm.c | 2 +- bsp/at32/libraries/rt_drivers/drv_pwm.c | 2 +- bsp/essemi/es32f0654/drivers/drv_hwtimer.c | 2 +- bsp/essemi/es32f0654/drivers/drv_pwm.c | 2 +- bsp/essemi/es32f369x/drivers/drv_hwtimer.c | 2 +- bsp/essemi/es32f369x/drivers/drv_pwm.c | 2 +- bsp/ft2004/drivers/drv_sdctrl.c | 2 +- bsp/gd32105c-eval/drivers/drv_gpio.c | 20 ++++++++--------- bsp/gd32107c-eval/drivers/drv_gpio.c | 20 ++++++++--------- bsp/gd32303e-eval/drivers/drv_gpio.c | 20 ++++++++--------- bsp/gd32350r-eval/drivers/drv_gpio.c | 20 ++++++++--------- bsp/gd32e230k-start/drivers/drv_gpio.c | 20 ++++++++--------- bsp/hc32/libraries/hc32_drivers/drv_can.c | 2 +- .../libraries/hc32_drivers/drv_pwm_tmra.c | 2 +- bsp/hc32/libraries/hc32_drivers/drv_spi.c | 2 +- bsp/hpmicro/libraries/drivers/drv_gpio.c | 2 +- bsp/hpmicro/libraries/drivers/drv_rtc.c | 2 +- bsp/hpmicro/libraries/drivers/drv_spi.c | 2 +- bsp/hpmicro/libraries/drivers/drv_usb.c | 2 +- bsp/hpmicro/libraries/drivers/drv_wdt.c | 2 +- bsp/imxrt/libraries/drivers/drv_gpio.c | 2 +- bsp/imxrt/libraries/drivers/drv_pwm.c | 4 ++-- bsp/imxrt/libraries/drivers/drv_spi.c | 2 +- bsp/imxrt/libraries/drivers/drv_wdt.c | 4 ++-- bsp/loongson/ls2kdev/drivers/drv_pwm.c | 2 +- bsp/lpc55sxx/Libraries/drivers/drv_pwm.c | 2 +- bsp/lpc55sxx/Libraries/drivers/drv_rtc.c | 2 +- bsp/lpc55sxx/Libraries/drivers/drv_wdt.c | 2 +- bsp/n32/libraries/n32_drivers/drv_adc.c | 4 ++-- bsp/n32/libraries/n32_drivers/drv_wdt.c | 2 +- bsp/n32g452xx/Libraries/rt_drivers/drv_pwm.c | 2 +- bsp/nrf5x/libraries/drivers/drv_gpio.c | 6 ++--- bsp/nrf5x/libraries/drivers/drv_gpio.h | 12 ++-------- bsp/nrf5x/libraries/drivers/drv_pwm.c | 2 +- .../libraries/gd32vf103/HAL_Drivers/drv_adc.c | 4 ++-- .../gd32vf103/HAL_Drivers/drv_gpio.c | 4 ++-- .../libraries/gd32vf103/HAL_Drivers/drv_pwm.c | 12 +++++----- .../libraries/gd32vf103/HAL_Drivers/drv_rtc.c | 2 +- .../libraries/gd32vf103/HAL_Drivers/drv_wdt.c | 2 +- .../libraries/m031/rtt_port/drv_bpwm.c | 2 +- .../libraries/m031/rtt_port/drv_pdma.c | 14 ++++++------ .../libraries/m031/rtt_port/drv_qspi.c | 2 +- bsp/nuvoton/libraries/m031/rtt_port/drv_spi.c | 2 +- .../libraries/m031/rtt_port/drv_timer.c | 2 +- .../libraries/m031/rtt_port/drv_uart.c | 6 ++--- .../libraries/m031/rtt_port/drv_uspi.c | 2 +- .../libraries/m031/rtt_port/drv_uuart.c | 6 ++--- bsp/nuvoton/libraries/m031/rtt_port/drv_wdt.c | 6 ++--- .../libraries/m2354/rtt_port/drv_bpwm.c | 2 +- .../libraries/m2354/rtt_port/drv_pdma.c | 14 ++++++------ .../libraries/m2354/rtt_port/drv_qspi.c | 2 +- .../libraries/m2354/rtt_port/drv_scuart.c | 6 ++--- .../libraries/m2354/rtt_port/drv_spi.c | 2 +- .../libraries/m2354/rtt_port/drv_timer.c | 2 +- .../libraries/m2354/rtt_port/drv_uart.c | 6 ++--- .../libraries/m2354/rtt_port/drv_uspi.c | 2 +- .../libraries/m2354/rtt_port/drv_uuart.c | 6 ++--- .../libraries/m2354/rtt_port/drv_wdt.c | 6 ++--- bsp/nuvoton/libraries/m460/rtt_port/drv_dac.c | 2 +- .../libraries/m460/rtt_port/drv_eadc.c | 2 +- .../libraries/m460/rtt_port/drv_pdma.c | 16 +++++++------- .../libraries/m460/rtt_port/drv_qspi.c | 2 +- .../libraries/m460/rtt_port/drv_scuart.c | 6 ++--- bsp/nuvoton/libraries/m460/rtt_port/drv_spi.c | 2 +- .../libraries/m460/rtt_port/drv_timer.c | 4 ++-- .../libraries/m460/rtt_port/drv_uart.c | 6 ++--- .../libraries/m460/rtt_port/drv_uspi.c | 2 +- .../libraries/m460/rtt_port/drv_uuart.c | 6 ++--- bsp/nuvoton/libraries/m460/rtt_port/drv_wdt.c | 6 ++--- .../libraries/m480/rtt_port/drv_bpwm.c | 2 +- .../libraries/m480/rtt_port/drv_pdma.c | 14 ++++++------ .../libraries/m480/rtt_port/drv_qspi.c | 2 +- .../libraries/m480/rtt_port/drv_scuart.c | 6 ++--- bsp/nuvoton/libraries/m480/rtt_port/drv_spi.c | 2 +- .../libraries/m480/rtt_port/drv_timer.c | 2 +- .../libraries/m480/rtt_port/drv_uart.c | 6 ++--- .../libraries/m480/rtt_port/drv_uspi.c | 2 +- .../libraries/m480/rtt_port/drv_uuart.c | 6 ++--- bsp/nuvoton/libraries/m480/rtt_port/drv_wdt.c | 6 ++--- bsp/nuvoton/libraries/ma35/rtt_port/drv_adc.c | 4 ++-- .../libraries/ma35/rtt_port/drv_pdma.c | 16 +++++++------- .../libraries/ma35/rtt_port/drv_qspi.c | 2 +- .../libraries/ma35/rtt_port/drv_scuart.c | 6 ++--- bsp/nuvoton/libraries/ma35/rtt_port/drv_spi.c | 2 +- .../libraries/ma35/rtt_port/drv_timer.c | 4 ++-- .../libraries/ma35/rtt_port/drv_uart.c | 6 ++--- bsp/nuvoton/libraries/ma35/rtt_port/drv_wdt.c | 8 +++---- .../libraries/n9h30/rtt_port/drv_adc.c | 4 ++-- .../libraries/n9h30/rtt_port/drv_etimer.c | 4 ++-- .../libraries/n9h30/rtt_port/drv_pwm.c | 2 +- .../libraries/n9h30/rtt_port/drv_qspi.c | 2 +- .../libraries/n9h30/rtt_port/drv_scuart.c | 6 ++--- .../libraries/n9h30/rtt_port/drv_timer.c | 4 ++-- .../libraries/n9h30/rtt_port/drv_uart.c | 6 ++--- .../libraries/n9h30/rtt_port/drv_wdt.c | 6 ++--- .../libraries/nu_packages/SPINAND/spinand.c | 2 +- .../libraries/nuc980/rtt_port/drv_adc.c | 4 ++-- .../libraries/nuc980/rtt_port/drv_etimer.c | 4 ++-- .../libraries/nuc980/rtt_port/drv_pdma.c | 16 +++++++------- .../libraries/nuc980/rtt_port/drv_pwm.c | 2 +- .../libraries/nuc980/rtt_port/drv_qspi.c | 2 +- .../libraries/nuc980/rtt_port/drv_scuart.c | 6 ++--- .../libraries/nuc980/rtt_port/drv_spi.c | 2 +- .../libraries/nuc980/rtt_port/drv_uart.c | 6 ++--- .../libraries/nuc980/rtt_port/drv_wdt.c | 6 ++--- bsp/qemu-virt64-aarch64/drivers/drv_rtc.c | 2 +- bsp/raspberry-pi/raspi3-32/driver/drv_rtc.c | 2 +- bsp/raspberry-pi/raspi3-64/driver/drv_rtc.c | 2 +- bsp/rockchip/common/drivers/drv_gpio.c | 2 +- bsp/synwit/swm320/drivers/drv_gpio.c | 2 +- bsp/synwit/swm320/drivers/drv_pwm.c | 2 +- bsp/synwit/swm320/drivers/drv_spi.c | 2 +- bsp/synwit/swm341/drivers/drv_gpio.c | 2 +- bsp/synwit/swm341/drivers/drv_pwm.c | 2 +- bsp/synwit/swm341/drivers/drv_spi.c | 2 +- bsp/ti/c28x/libraries/HAL_Drivers/drv_pwm.c | 2 +- bsp/tm4c123bsp/libraries/Drivers/drv_pwm.c | 2 +- bsp/w60x/drivers/drv_pwm.c | 4 ++-- bsp/w60x/drivers/drv_rtc.c | 2 +- bsp/w60x/drivers/drv_wifi.c | 2 +- .../ch32_drivers/drv_gpio_ch32f10x.c | 4 ++-- .../ch32_drivers/drv_gpio_ch32f20x.c | 4 ++-- .../ch32_drivers/drv_hwtimer_ch32f10x.c | 2 +- .../ch32_drivers/drv_hwtimer_ch32f20x.c | 2 +- .../Libraries/ch32_drivers/drv_pwm_ch32f10x.c | 10 ++++----- .../Libraries/ch32_drivers/drv_pwm_ch32f20x.c | 10 ++++----- bsp/yichip/yc3121-pos/drivers/drv_gpio.c | 2 +- components/drivers/wlan/wlan_mgnt.c | 4 ++-- components/lwp/lwp_signal.c | 2 +- components/utilities/rt-link/src/rtlink_dev.c | 2 +- 136 files changed, 316 insertions(+), 324 deletions(-) diff --git a/bsp/Infineon/libraries/HAL_Drivers/drv_pwm.c b/bsp/Infineon/libraries/HAL_Drivers/drv_pwm.c index e87d205f44..dd3a6a316e 100644 --- a/bsp/Infineon/libraries/HAL_Drivers/drv_pwm.c +++ b/bsp/Infineon/libraries/HAL_Drivers/drv_pwm.c @@ -153,7 +153,7 @@ static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg return drv_pwm_get(htim, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/airm2m/air105/libraries/rt_drivers/drv_spi.c b/bsp/airm2m/air105/libraries/rt_drivers/drv_spi.c index 7765139372..4515b772f9 100644 --- a/bsp/airm2m/air105/libraries/rt_drivers/drv_spi.c +++ b/bsp/airm2m/air105/libraries/rt_drivers/drv_spi.c @@ -96,7 +96,7 @@ static rt_err_t spi_configure(struct rt_spi_device *device, RT_ASSERT(configuration != RT_NULL); rt_uint32_t spi_id = device->bus->parent.user_data; rt_uint8_t mode = configuration->mode & (RT_SPI_CPHA | RT_SPI_CPOL); - if (configuration->mode & RT_SPI_SLAVE) return RT_EINVAL; + if (configuration->mode & RT_SPI_SLAVE) return -RT_EINVAL; switch(spi_id) { case 0: diff --git a/bsp/airm2m/air32f103/libraries/rt_drivers/drv_hwtimer.c b/bsp/airm2m/air32f103/libraries/rt_drivers/drv_hwtimer.c index 82cea478be..5c95fe1bb5 100644 --- a/bsp/airm2m/air32f103/libraries/rt_drivers/drv_hwtimer.c +++ b/bsp/airm2m/air32f103/libraries/rt_drivers/drv_hwtimer.c @@ -171,7 +171,7 @@ static rt_err_t air32_hwtimer_control(struct rt_hwtimer_device *device, rt_uint3 } else { - result = RT_EINVAL; + result = -RT_EINVAL; } } break; diff --git a/bsp/allwinner_tina/drivers/drv_clock.c b/bsp/allwinner_tina/drivers/drv_clock.c index 9fec431f4b..6a8accb93d 100644 --- a/bsp/allwinner_tina/drivers/drv_clock.c +++ b/bsp/allwinner_tina/drivers/drv_clock.c @@ -211,7 +211,7 @@ rt_err_t cpu_set_pll_clk(int clk) int p = 0, k = 1, m = 1, n = 0; if (clk == 0) - return RT_EINVAL; + return -RT_EINVAL; if (clk > 1152000000) { @@ -244,7 +244,7 @@ rt_err_t audio_set_pll_clk(int clk) int m_temp = _24MHZ_ * 2; if ((clk > 200000000) || (clk < 20000000)) - return RT_EINVAL; + return -RT_EINVAL; if (clk == 0) { @@ -288,7 +288,7 @@ rt_err_t video_set_pll_clk(int clk) int m_temp = _24MHZ_; if ((clk > 600000000) || (clk < 30000000)) - return RT_EINVAL; + return -RT_EINVAL; if (clk == 0) { @@ -333,7 +333,7 @@ rt_err_t ve_set_pll_clk(int clk) int m_temp = _24MHZ_; if ((clk > 600000000) || (clk < 30000000)) - return RT_EINVAL; + return -RT_EINVAL; if (clk == 0) { @@ -377,7 +377,7 @@ rt_err_t periph_set_pll_clk(int clk) int n = 0, k = 0; if ((clk > 1800000000) || (clk < 200000000) || (clk == 0) || (clk % _24MHZ_ != 0)) - return RT_EINVAL; + return -RT_EINVAL; n = clk / _24MHZ_; @@ -413,7 +413,7 @@ rt_err_t periph_set_pll_clk(int clk) rt_err_t cpu_set_clk(int clk) { if (clk < _24MHZ_) - return RT_EINVAL; + return -RT_EINVAL; if (clk == cpu_get_clk()) return RT_EOK; @@ -446,7 +446,7 @@ rt_err_t bus_gate_clk_enalbe(enum bus_gate bus) else if (gate_reg == 0x02) CCU->bus_clk_gating2 |= (0x1 << offset); else - return RT_EINVAL; + return -RT_EINVAL; return RT_EOK; } @@ -466,7 +466,7 @@ rt_err_t bus_gate_clk_disalbe(enum bus_gate bus) else if (gate_reg == 0x02) CCU->bus_clk_gating2 &= ~(0x1 << offset); else - return RT_EINVAL; + return -RT_EINVAL; return RT_EOK; } @@ -486,7 +486,7 @@ rt_err_t bus_software_reset_disalbe(enum bus_gate bus) else if (gate_reg == 0x02) CCU->bus_soft_rst2 |= (0x1 << offset); else - return RT_EINVAL; + return -RT_EINVAL; return RT_EOK; } @@ -506,7 +506,7 @@ rt_err_t bus_software_reset_enalbe(enum bus_gate bus) else if (gate_reg == 0x02) CCU->bus_soft_rst2 &= ~(0x1 << offset); else - return RT_EINVAL; + return -RT_EINVAL; return RT_EOK; } @@ -519,7 +519,7 @@ rt_err_t mmc_set_clk(enum mmc_clk_id clk_id, int hz) if (hz < 0) { - return RT_EINVAL; + return -RT_EINVAL; } if (hz == 0) diff --git a/bsp/allwinner_tina/drivers/drv_gpio.c b/bsp/allwinner_tina/drivers/drv_gpio.c index 099ea7621d..9617be1684 100644 --- a/bsp/allwinner_tina/drivers/drv_gpio.c +++ b/bsp/allwinner_tina/drivers/drv_gpio.c @@ -25,7 +25,7 @@ /********************************************************* ** IO *********************************************************/ -int gpio_set_func(enum gpio_port port, enum gpio_pin pin, rt_uint8_t func) +rt_err_t gpio_set_func(enum gpio_port port, enum gpio_pin pin, rt_uint8_t func) { rt_uint32_t addr; rt_uint32_t offset; @@ -37,7 +37,7 @@ int gpio_set_func(enum gpio_port port, enum gpio_pin pin, rt_uint8_t func) if (func & 0x8) { LOG_W("[line]:%d There is a warning with parameter input", __LINE__); - return RT_EINVAL; + return -RT_EINVAL; } addr = GPIOn_CFG_ADDR(port) + (pin / 8) * 4; @@ -64,7 +64,7 @@ int gpio_set_value(enum gpio_port port, enum gpio_pin pin, rt_uint8_t value) if (value & 0xE) { LOG_W("[line]:%d There is a warning with parameter input", __LINE__); - return RT_EINVAL; + return -RT_EINVAL; } addr = GPIOn_DATA_ADDR(port); @@ -109,7 +109,7 @@ int gpio_set_pull_mode(enum gpio_port port, enum gpio_pin pin, enum gpio_pull p if (pull & 0xC) { LOG_W("[line]:%d There is a warning with parameter input", __LINE__); - return RT_EINVAL; + return -RT_EINVAL; } addr = GPIOn_PUL_ADDR(port); @@ -137,7 +137,7 @@ int gpio_set_drive_level(enum gpio_port port, enum gpio_pin pin, enum gpio_drv_l if (level & 0xC) { LOG_W("[line]:%d There is a warning with parameter input", __LINE__); - return RT_EINVAL; + return -RT_EINVAL; } addr = GPIOn_DRV_ADDR(port); diff --git a/bsp/allwinner_tina/drivers/drv_gpio.h b/bsp/allwinner_tina/drivers/drv_gpio.h index 74dd5a9be0..6f3ae75686 100644 --- a/bsp/allwinner_tina/drivers/drv_gpio.h +++ b/bsp/allwinner_tina/drivers/drv_gpio.h @@ -212,7 +212,7 @@ typedef struct tina_gpio *tina_gpio_t; #define GPIO ((tina_gpio_t)GPIO_BASE_ADDR) -int gpio_set_func(enum gpio_port port, enum gpio_pin pin, rt_uint8_t func); +rt_err_t gpio_set_func(enum gpio_port port, enum gpio_pin pin, rt_uint8_t func); int gpio_set_value(enum gpio_port port, enum gpio_pin pin, rt_uint8_t value); int gpio_get_value(enum gpio_port port, enum gpio_pin pin); int gpio_set_pull_mode(enum gpio_port port, enum gpio_pin pin, enum gpio_pull pull); diff --git a/bsp/apm32/libraries/Drivers/drv_pwm.c b/bsp/apm32/libraries/Drivers/drv_pwm.c index ff712222ad..d710503de7 100644 --- a/bsp/apm32/libraries/Drivers/drv_pwm.c +++ b/bsp/apm32/libraries/Drivers/drv_pwm.c @@ -583,7 +583,7 @@ static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg case PWM_CMD_GET: return drv_pwm_get(tmr, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/at32/libraries/rt_drivers/drv_pwm.c b/bsp/at32/libraries/rt_drivers/drv_pwm.c index 339aeb1620..32e15af868 100644 --- a/bsp/at32/libraries/rt_drivers/drv_pwm.c +++ b/bsp/at32/libraries/rt_drivers/drv_pwm.c @@ -423,7 +423,7 @@ static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg case PWM_CMD_GET: return drv_pwm_get(tmr_x, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/essemi/es32f0654/drivers/drv_hwtimer.c b/bsp/essemi/es32f0654/drivers/drv_hwtimer.c index 09bf3c433a..498d6c3a46 100644 --- a/bsp/essemi/es32f0654/drivers/drv_hwtimer.c +++ b/bsp/essemi/es32f0654/drivers/drv_hwtimer.c @@ -305,7 +305,7 @@ static rt_err_t es32f0_hwtimer_control(rt_hwtimer_t *timer, break; default: - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/essemi/es32f0654/drivers/drv_pwm.c b/bsp/essemi/es32f0654/drivers/drv_pwm.c index 765c8eecad..18ce1562c6 100644 --- a/bsp/essemi/es32f0654/drivers/drv_pwm.c +++ b/bsp/essemi/es32f0654/drivers/drv_pwm.c @@ -80,7 +80,7 @@ static rt_err_t es32f0_pwm_control(struct rt_device_pwm *device, int cmd, void * _ccep_ch_en = timer_initstruct->perh->CCEP & TIMER_CCEP_CC4EN_MSK; } else - return RT_EINVAL; + return -RT_EINVAL; switch (cmd) { diff --git a/bsp/essemi/es32f369x/drivers/drv_hwtimer.c b/bsp/essemi/es32f369x/drivers/drv_hwtimer.c index be50c26f61..5b26407252 100644 --- a/bsp/essemi/es32f369x/drivers/drv_hwtimer.c +++ b/bsp/essemi/es32f369x/drivers/drv_hwtimer.c @@ -301,7 +301,7 @@ static rt_err_t es32f3_hwtimer_control(rt_hwtimer_t *timer, break; default: - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/essemi/es32f369x/drivers/drv_pwm.c b/bsp/essemi/es32f369x/drivers/drv_pwm.c index 0645370168..7683b7bd22 100644 --- a/bsp/essemi/es32f369x/drivers/drv_pwm.c +++ b/bsp/essemi/es32f369x/drivers/drv_pwm.c @@ -81,7 +81,7 @@ static rt_err_t es32f3_pwm_control(struct rt_device_pwm *device, int cmd, void * _ccep_ch_en = timer_initstruct->perh->CCEP & TIMER_CCEP_CC4EN_MSK; } else - return RT_EINVAL; + return -RT_EINVAL; switch (cmd) { diff --git a/bsp/ft2004/drivers/drv_sdctrl.c b/bsp/ft2004/drivers/drv_sdctrl.c index a501e41aac..a43a53a2c0 100644 --- a/bsp/ft2004/drivers/drv_sdctrl.c +++ b/bsp/ft2004/drivers/drv_sdctrl.c @@ -243,7 +243,7 @@ static void rthw_sdctrl_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req if (pkg.cmd->cmd_code == 5 || pkg.cmd->cmd_code == 1) { rt_kprintf("cmd_code is not vaild %x \r\n", pkg.cmd->cmd_code); - pkg.cmd->err = RT_EINVAL; + pkg.cmd->err = -RT_EINVAL; goto _exit; } diff --git a/bsp/gd32105c-eval/drivers/drv_gpio.c b/bsp/gd32105c-eval/drivers/drv_gpio.c index 40cd8df4b5..2c64de1c8e 100644 --- a/bsp/gd32105c-eval/drivers/drv_gpio.c +++ b/bsp/gd32105c-eval/drivers/drv_gpio.c @@ -325,12 +325,12 @@ static rt_err_t _pin_attach_irq(struct rt_device *device, rt_int32_t pin, index = get_pin(pin); if (index == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } hdr_index = bit2bitno(index->pin); if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map)) { - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); @@ -364,12 +364,12 @@ static rt_err_t _pin_detach_irq(struct rt_device *device, rt_int32_t pin) index = get_pin(pin); if (index == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } hdr_index = bit2bitno(index->pin); if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map)) { - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); @@ -397,20 +397,20 @@ static rt_err_t _pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint index = get_pin(pin); if (index == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } if (enabled == PIN_IRQ_ENABLE) { hdr_index = bit2bitno(index->pin); if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map)) { - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); if (pin_irq_hdr_tab[hdr_index].pin == -1) { rt_hw_interrupt_enable(level); - return RT_EINVAL; + return -RT_EINVAL; } irqmap = &pin_irq_map[hdr_index]; @@ -427,7 +427,7 @@ static rt_err_t _pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint break; default: rt_hw_interrupt_enable(level); - return RT_EINVAL; + return -RT_EINVAL; } rcu_periph_clock_enable(RCU_AF); @@ -449,13 +449,13 @@ static rt_err_t _pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint irqmap = get_pin_irq_map(index->pin); if (irqmap == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } nvic_irq_disable(irqmap->irqno); } else { - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; diff --git a/bsp/gd32107c-eval/drivers/drv_gpio.c b/bsp/gd32107c-eval/drivers/drv_gpio.c index 40cd8df4b5..2c64de1c8e 100644 --- a/bsp/gd32107c-eval/drivers/drv_gpio.c +++ b/bsp/gd32107c-eval/drivers/drv_gpio.c @@ -325,12 +325,12 @@ static rt_err_t _pin_attach_irq(struct rt_device *device, rt_int32_t pin, index = get_pin(pin); if (index == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } hdr_index = bit2bitno(index->pin); if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map)) { - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); @@ -364,12 +364,12 @@ static rt_err_t _pin_detach_irq(struct rt_device *device, rt_int32_t pin) index = get_pin(pin); if (index == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } hdr_index = bit2bitno(index->pin); if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map)) { - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); @@ -397,20 +397,20 @@ static rt_err_t _pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint index = get_pin(pin); if (index == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } if (enabled == PIN_IRQ_ENABLE) { hdr_index = bit2bitno(index->pin); if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map)) { - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); if (pin_irq_hdr_tab[hdr_index].pin == -1) { rt_hw_interrupt_enable(level); - return RT_EINVAL; + return -RT_EINVAL; } irqmap = &pin_irq_map[hdr_index]; @@ -427,7 +427,7 @@ static rt_err_t _pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint break; default: rt_hw_interrupt_enable(level); - return RT_EINVAL; + return -RT_EINVAL; } rcu_periph_clock_enable(RCU_AF); @@ -449,13 +449,13 @@ static rt_err_t _pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint irqmap = get_pin_irq_map(index->pin); if (irqmap == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } nvic_irq_disable(irqmap->irqno); } else { - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; diff --git a/bsp/gd32303e-eval/drivers/drv_gpio.c b/bsp/gd32303e-eval/drivers/drv_gpio.c index a96cecc13e..b3b34b25bd 100644 --- a/bsp/gd32303e-eval/drivers/drv_gpio.c +++ b/bsp/gd32303e-eval/drivers/drv_gpio.c @@ -350,12 +350,12 @@ rt_err_t gd32_pin_attach_irq(struct rt_device *device, rt_int32_t pin, index = get_pin(pin); if (index == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } hdr_index = bit2bitno(index->pin); if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map)) { - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); @@ -389,12 +389,12 @@ rt_err_t gd32_pin_detach_irq(struct rt_device *device, rt_int32_t pin) index = get_pin(pin); if (index == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } hdr_index = bit2bitno(index->pin); if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map)) { - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); @@ -422,20 +422,20 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_ index = get_pin(pin); if (index == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } if (enabled == PIN_IRQ_ENABLE) { hdr_index = bit2bitno(index->pin); if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map)) { - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); if (pin_irq_hdr_tab[hdr_index].pin == -1) { rt_hw_interrupt_enable(level); - return RT_EINVAL; + return -RT_EINVAL; } irqmap = &pin_irq_map[hdr_index]; @@ -452,7 +452,7 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_ break; default: rt_hw_interrupt_enable(level); - return RT_EINVAL; + return -RT_EINVAL; } rcu_periph_clock_enable(RCU_AF); @@ -474,13 +474,13 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_ irqmap = get_pin_irq_map(index->pin); if (irqmap == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } nvic_irq_disable(irqmap->irqno); } else { - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; diff --git a/bsp/gd32350r-eval/drivers/drv_gpio.c b/bsp/gd32350r-eval/drivers/drv_gpio.c index 7d15638d5f..e22b94645c 100644 --- a/bsp/gd32350r-eval/drivers/drv_gpio.c +++ b/bsp/gd32350r-eval/drivers/drv_gpio.c @@ -272,13 +272,13 @@ rt_err_t gd32_pin_attach_irq(struct rt_device *device, rt_int32_t pin, index = get_pin(pin); if (index == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } hdr_index = bit2bitno(index->pin); if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map)) { - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); @@ -313,13 +313,13 @@ rt_err_t gd32_pin_detach_irq(struct rt_device *device, rt_int32_t pin) index = get_pin(pin); if (index == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } hdr_index = bit2bitno(index->pin); if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map)) { - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); @@ -348,7 +348,7 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_ index = get_pin(pin); if (index == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } if (enabled == PIN_IRQ_ENABLE) @@ -356,14 +356,14 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_ hdr_index = bit2bitno(index->pin); if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map)) { - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); if (pin_irq_hdr_tab[hdr_index].pin == -1) { rt_hw_interrupt_enable(level); - return RT_EINVAL; + return -RT_EINVAL; } irqmap = &pin_irq_map[hdr_index]; @@ -381,7 +381,7 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_ break; default: rt_hw_interrupt_enable(level); - return RT_EINVAL; + return -RT_EINVAL; } rcu_periph_clock_enable(RCU_CFGCMP); @@ -403,13 +403,13 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_ irqmap = get_pin_irq_map(index->pin); if (irqmap == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } nvic_irq_disable(irqmap->irqno); } else { - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; diff --git a/bsp/gd32e230k-start/drivers/drv_gpio.c b/bsp/gd32e230k-start/drivers/drv_gpio.c index 752f1489d7..a9475c8c9b 100644 --- a/bsp/gd32e230k-start/drivers/drv_gpio.c +++ b/bsp/gd32e230k-start/drivers/drv_gpio.c @@ -245,12 +245,12 @@ rt_err_t gd32_pin_attach_irq(struct rt_device *device, rt_int32_t pin, index = get_pin(pin); if (index == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } hdr_index = bit2bitno(index->pin); if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map)) { - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); @@ -284,12 +284,12 @@ rt_err_t gd32_pin_detach_irq(struct rt_device *device, rt_int32_t pin) index = get_pin(pin); if (index == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } hdr_index = bit2bitno(index->pin); if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map)) { - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); @@ -317,20 +317,20 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_ index = get_pin(pin); if (index == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } if (enabled == PIN_IRQ_ENABLE) { hdr_index = bit2bitno(index->pin); if (hdr_index < 0 || hdr_index >= ITEM_NUM(pin_irq_map)) { - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); if (pin_irq_hdr_tab[hdr_index].pin == -1) { rt_hw_interrupt_enable(level); - return RT_EINVAL; + return -RT_EINVAL; } irqmap = &pin_irq_map[hdr_index]; @@ -347,7 +347,7 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_ break; default: rt_hw_interrupt_enable(level); - return RT_EINVAL; + return -RT_EINVAL; } //rcu_periph_clock_enable(RCU_AF); @@ -369,13 +369,13 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_ irqmap = get_pin_irq_map(index->pin); if (irqmap == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } nvic_irq_disable(irqmap->irqno); } else { - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; diff --git a/bsp/hc32/libraries/hc32_drivers/drv_can.c b/bsp/hc32/libraries/hc32_drivers/drv_can.c index d2770144ec..211adc81b2 100644 --- a/bsp/hc32/libraries/hc32_drivers/drv_can.c +++ b/bsp/hc32/libraries/hc32_drivers/drv_can.c @@ -160,7 +160,7 @@ static rt_err_t _can_config(struct rt_can_device *can, struct can_configure *cfg int32_t ret = CAN_Init(p_can_dev->instance, &p_can_dev->ll_init); if (ret != LL_OK) { - rt_ret = RT_EINVAL; + rt_ret = -RT_EINVAL; } return rt_ret; diff --git a/bsp/hc32/libraries/hc32_drivers/drv_pwm_tmra.c b/bsp/hc32/libraries/hc32_drivers/drv_pwm_tmra.c index 9f7fdaf76e..2798741697 100644 --- a/bsp/hc32/libraries/hc32_drivers/drv_pwm_tmra.c +++ b/bsp/hc32/libraries/hc32_drivers/drv_pwm_tmra.c @@ -209,7 +209,7 @@ static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg case PWM_CMD_GET: return drv_pwm_get(TMRAx, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/hc32/libraries/hc32_drivers/drv_spi.c b/bsp/hc32/libraries/hc32_drivers/drv_spi.c index d3a84c3c8c..a24d932065 100644 --- a/bsp/hc32/libraries/hc32_drivers/drv_spi.c +++ b/bsp/hc32/libraries/hc32_drivers/drv_spi.c @@ -156,7 +156,7 @@ static rt_err_t hc32_spi_init(struct hc32_spi *spi_drv, struct rt_spi_configurat /* SI/SO pin shared */ if (cfg->mode & RT_SPI_3WIRE) { - return RT_EINVAL; + return -RT_EINVAL; } else { diff --git a/bsp/hpmicro/libraries/drivers/drv_gpio.c b/bsp/hpmicro/libraries/drivers/drv_gpio.c index 520dfa1824..94304fd53c 100644 --- a/bsp/hpmicro/libraries/drivers/drv_gpio.c +++ b/bsp/hpmicro/libraries/drivers/drv_gpio.c @@ -297,7 +297,7 @@ static rt_err_t hpm_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_u } else { - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; diff --git a/bsp/hpmicro/libraries/drivers/drv_rtc.c b/bsp/hpmicro/libraries/drivers/drv_rtc.c index 114ad7a07b..a70d27ada1 100644 --- a/bsp/hpmicro/libraries/drivers/drv_rtc.c +++ b/bsp/hpmicro/libraries/drivers/drv_rtc.c @@ -86,7 +86,7 @@ static rt_err_t hpm_rtc_control(rt_device_t dev, int cmd, void *args) hpm_rtc_set_timestamp(*(time_t *)args); break; default: - err = RT_EINVAL; + err = -RT_EINVAL; break; } diff --git a/bsp/hpmicro/libraries/drivers/drv_spi.c b/bsp/hpmicro/libraries/drivers/drv_spi.c index 7dd6def0d7..55f91d3c38 100644 --- a/bsp/hpmicro/libraries/drivers/drv_spi.c +++ b/bsp/hpmicro/libraries/drivers/drv_spi.c @@ -73,7 +73,7 @@ static rt_err_t hpm_spi_configure(struct rt_spi_device *device, struct rt_spi_co if (cfg->data_width != 8 && cfg->data_width != 16 && cfg->data_width != 32) { - return RT_EINVAL; + return -RT_EINVAL; } spi_master_get_default_timing_config(&timing_config); diff --git a/bsp/hpmicro/libraries/drivers/drv_usb.c b/bsp/hpmicro/libraries/drivers/drv_usb.c index 1d00550e0b..fd64d369e4 100644 --- a/bsp/hpmicro/libraries/drivers/drv_usb.c +++ b/bsp/hpmicro/libraries/drivers/drv_usb.c @@ -93,7 +93,7 @@ rt_err_t hpm_usb_control(rt_device_t dev, int cmd, void *args) break; default: - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/hpmicro/libraries/drivers/drv_wdt.c b/bsp/hpmicro/libraries/drivers/drv_wdt.c index 5b21102680..f999139042 100644 --- a/bsp/hpmicro/libraries/drivers/drv_wdt.c +++ b/bsp/hpmicro/libraries/drivers/drv_wdt.c @@ -207,7 +207,7 @@ static rt_err_t hpm_wdog_control(rt_watchdog_t *wdt, int cmd, void *args) hpm_wdog_close(wdt); break; default: - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/imxrt/libraries/drivers/drv_gpio.c b/bsp/imxrt/libraries/drivers/drv_gpio.c index f5d0812d55..dc61760eb2 100644 --- a/bsp/imxrt/libraries/drivers/drv_gpio.c +++ b/bsp/imxrt/libraries/drivers/drv_gpio.c @@ -774,7 +774,7 @@ static rt_err_t imxrt_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt } else { - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; diff --git a/bsp/imxrt/libraries/drivers/drv_pwm.c b/bsp/imxrt/libraries/drivers/drv_pwm.c index 1a4f0042ab..c73044af26 100644 --- a/bsp/imxrt/libraries/drivers/drv_pwm.c +++ b/bsp/imxrt/libraries/drivers/drv_pwm.c @@ -144,7 +144,7 @@ static rt_err_t imxrt_drv_pwm_control(struct rt_device_pwm *device, int cmd, voi case PWM_CMD_GET: return imxrt_drv_pwm_get(device, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } @@ -422,7 +422,7 @@ static rt_err_t imxrt_drv_qtmr_control(struct rt_device_pwm *device, int cmd, vo case PWM_CMD_GET: return imxrt_drv_qtmr_get(device, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/imxrt/libraries/drivers/drv_spi.c b/bsp/imxrt/libraries/drivers/drv_spi.c index d0ce55b35d..3c1ad39888 100644 --- a/bsp/imxrt/libraries/drivers/drv_spi.c +++ b/bsp/imxrt/libraries/drivers/drv_spi.c @@ -279,7 +279,7 @@ static rt_err_t spi_configure(struct rt_spi_device *device, struct rt_spi_config if(cfg->data_width != 8 && cfg->data_width != 16 && cfg->data_width != 32) { - return RT_EINVAL; + return -RT_EINVAL; } LPSPI_MasterGetDefaultConfig(&masterConfig); diff --git a/bsp/imxrt/libraries/drivers/drv_wdt.c b/bsp/imxrt/libraries/drivers/drv_wdt.c index 6010754c54..9c5b46313c 100644 --- a/bsp/imxrt/libraries/drivers/drv_wdt.c +++ b/bsp/imxrt/libraries/drivers/drv_wdt.c @@ -139,7 +139,7 @@ static rt_err_t imxrt_hp_wdog3_control(rt_watchdog_t *wdt, int cmd, void *args) } break; default: - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; @@ -274,7 +274,7 @@ static rt_err_t imxrt_hp_wdog_control(rt_watchdog_t *wdt, int cmd, void *args) } break; default: - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; diff --git a/bsp/loongson/ls2kdev/drivers/drv_pwm.c b/bsp/loongson/ls2kdev/drivers/drv_pwm.c index 1b5c98755d..a688699100 100644 --- a/bsp/loongson/ls2kdev/drivers/drv_pwm.c +++ b/bsp/loongson/ls2kdev/drivers/drv_pwm.c @@ -107,7 +107,7 @@ static rt_err_t loongson_pwm_ioctl(struct rt_device_pwm *device, int cmd, void * rc = RT_ENOSYS; break; default: - rc = RT_EINVAL; + rc = -RT_EINVAL; break; } return rc; diff --git a/bsp/lpc55sxx/Libraries/drivers/drv_pwm.c b/bsp/lpc55sxx/Libraries/drivers/drv_pwm.c index 0f8a4bb16a..e48a231f80 100644 --- a/bsp/lpc55sxx/Libraries/drivers/drv_pwm.c +++ b/bsp/lpc55sxx/Libraries/drivers/drv_pwm.c @@ -239,7 +239,7 @@ static rt_err_t lpc_drv_pwm_control(struct rt_device_pwm *device, int cmd, void case PWM_CMD_GET: return lpc_drv_pwm_get(device, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/lpc55sxx/Libraries/drivers/drv_rtc.c b/bsp/lpc55sxx/Libraries/drivers/drv_rtc.c index 2a627bb986..bbe75ac236 100644 --- a/bsp/lpc55sxx/Libraries/drivers/drv_rtc.c +++ b/bsp/lpc55sxx/Libraries/drivers/drv_rtc.c @@ -116,7 +116,7 @@ static rt_err_t lpc_rtc_control(rt_device_t dev, int cmd, void *args) break; default: - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; diff --git a/bsp/lpc55sxx/Libraries/drivers/drv_wdt.c b/bsp/lpc55sxx/Libraries/drivers/drv_wdt.c index 67524be683..206182fa41 100644 --- a/bsp/lpc55sxx/Libraries/drivers/drv_wdt.c +++ b/bsp/lpc55sxx/Libraries/drivers/drv_wdt.c @@ -204,7 +204,7 @@ static rt_err_t lpc_wwdt_control(rt_watchdog_t *wdt, int cmd, void *args) } break; default: - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; diff --git a/bsp/n32/libraries/n32_drivers/drv_adc.c b/bsp/n32/libraries/n32_drivers/drv_adc.c index 8d17f0d86f..92a00d8dea 100644 --- a/bsp/n32/libraries/n32_drivers/drv_adc.c +++ b/bsp/n32/libraries/n32_drivers/drv_adc.c @@ -92,7 +92,7 @@ static rt_err_t n32_adc_enabled(struct rt_adc_device *device, rt_uint32_t channe { if (channel > ADC_CH_18) { - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; } @@ -104,7 +104,7 @@ static rt_err_t n32_adc_convert(struct rt_adc_device *device, rt_uint32_t channe if (channel > ADC_CH_18) { - return RT_EINVAL; + return -RT_EINVAL; } config = (struct n32_adc_config *)(device->parent.user_data); diff --git a/bsp/n32/libraries/n32_drivers/drv_wdt.c b/bsp/n32/libraries/n32_drivers/drv_wdt.c index 0b043d2ef4..d4de0d3d72 100644 --- a/bsp/n32/libraries/n32_drivers/drv_wdt.c +++ b/bsp/n32/libraries/n32_drivers/drv_wdt.c @@ -151,7 +151,7 @@ static rt_err_t n32_wdt_control(rt_watchdog_t *wdt, int cmd, void *args) break; default: - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; diff --git a/bsp/n32g452xx/Libraries/rt_drivers/drv_pwm.c b/bsp/n32g452xx/Libraries/rt_drivers/drv_pwm.c index 22b79a6fbe..af0c2e4fbe 100644 --- a/bsp/n32g452xx/Libraries/rt_drivers/drv_pwm.c +++ b/bsp/n32g452xx/Libraries/rt_drivers/drv_pwm.c @@ -314,7 +314,7 @@ static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg case PWM_CMD_GET: return drv_pwm_get(pwm_dev, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/nrf5x/libraries/drivers/drv_gpio.c b/bsp/nrf5x/libraries/drivers/drv_gpio.c index 0d262cd83f..4d1f4db537 100644 --- a/bsp/nrf5x/libraries/drivers/drv_gpio.c +++ b/bsp/nrf5x/libraries/drivers/drv_gpio.c @@ -356,7 +356,7 @@ const static struct rt_pin_ops _nrf5x_pin_ops = RT_NULL, }; -int rt_hw_pin_init(void) +rt_err_t rt_hw_pin_init(void) { nrfx_err_t err_code; @@ -366,11 +366,11 @@ int rt_hw_pin_init(void) switch(err_code) { case NRFX_ERROR_INVALID_STATE: - return RT_EINVAL; + return -RT_EINVAL; case NRFX_SUCCESS: return RT_EOK; default: - return RT_ERROR;; + return -RT_ERROR;; } } diff --git a/bsp/nrf5x/libraries/drivers/drv_gpio.h b/bsp/nrf5x/libraries/drivers/drv_gpio.h index 0985c079c8..3e4b63c453 100644 --- a/bsp/nrf5x/libraries/drivers/drv_gpio.h +++ b/bsp/nrf5x/libraries/drivers/drv_gpio.h @@ -35,18 +35,10 @@ struct pin_index { int index; NRF_GPIO_Type *gpio;//NRF_P0 or NRF_P1 - uint32_t pin; + rt_base_t pin; }; -static void nrf5x_pin_write(rt_device_t dev, rt_base_t pin, rt_base_t value); -static int nrf5x_pin_read(rt_device_t dev, rt_base_t pin); -static void nrf5x_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode); -static rt_err_t nrf5x_pin_attach_irq(struct rt_device *device, rt_int32_t pin, - rt_uint32_t mode, void (*hdr)(void *args), void *args); -static rt_err_t nrf5x_pin_dettach_irq(struct rt_device *device, rt_int32_t pin); -static rt_err_t nrf5x_pin_irq_enable(struct rt_device *device, rt_base_t pin, - rt_uint32_t enabled); -int rt_hw_pin_init(void); +rt_err_t rt_hw_pin_init(void); #endif /* __DRV_GPIO_H__ */ diff --git a/bsp/nrf5x/libraries/drivers/drv_pwm.c b/bsp/nrf5x/libraries/drivers/drv_pwm.c index d71e4883a4..84cc72a678 100644 --- a/bsp/nrf5x/libraries/drivers/drv_pwm.c +++ b/bsp/nrf5x/libraries/drivers/drv_pwm.c @@ -212,7 +212,7 @@ static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg case PWM_CMD_GET: return drv_pwm_get(p_mcu, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_adc.c b/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_adc.c index 5e463be51d..93e82dd297 100644 --- a/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_adc.c +++ b/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_adc.c @@ -66,7 +66,7 @@ static rt_err_t gd32_adc_enabled(struct rt_adc_device *device, rt_uint32_t chann { if (channel > ADC_CHANNEL_17) { - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; } @@ -78,7 +78,7 @@ static rt_err_t gd32_adc_convert(struct rt_adc_device *device, rt_uint32_t chann if (channel > ADC_CHANNEL_17) { - return RT_EINVAL; + return -RT_EINVAL; } config = (struct gd32_adc_config *)(device->parent.user_data); diff --git a/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_gpio.c b/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_gpio.c index 779f4a7bb8..538ecb2c8a 100644 --- a/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_gpio.c +++ b/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_gpio.c @@ -379,7 +379,7 @@ static rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, break; default: rt_hw_interrupt_enable(level); - return RT_EINVAL; + return -RT_EINVAL; } /* connect EXTI line to GPIO pin */ @@ -404,7 +404,7 @@ static rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, irqmap = get_pin_irq_map(index->pin); if (irqmap == RT_NULL) { - return RT_EINVAL; + return -RT_EINVAL; } if ((irqmap->pinbit >= GPIO_PIN_5) && (irqmap->pinbit <= GPIO_PIN_9)) { diff --git a/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_pwm.c b/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_pwm.c index b7af639c53..053cd4d510 100644 --- a/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_pwm.c +++ b/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_pwm.c @@ -71,7 +71,7 @@ static rt_err_t gd32_pwm_enable(struct rt_device_pwm *device, struct rt_pwm_conf if (configuration->channel > GD32_MAX_PWM_CHANNELS) { - return RT_EINVAL; + return -RT_EINVAL; } if (!enable) { @@ -143,12 +143,12 @@ static rt_err_t gd32_pwm_set(struct rt_device_pwm *device, struct rt_pwm_configu if (configuration->channel > GD32_MAX_PWM_CHANNELS) { LOG_I("max channel supported is %d\n", GD32_MAX_PWM_CHANNELS); - return RT_EINVAL; + return -RT_EINVAL; } if (configuration->period < configuration->pulse) { LOG_I("period should > pulse \n"); - return RT_EINVAL; + return -RT_EINVAL; } pwmclk = gd32_get_pwm_clk(config->periph); @@ -157,12 +157,12 @@ static rt_err_t gd32_pwm_set(struct rt_device_pwm *device, struct rt_pwm_configu period_cmp = (uint64_t)(1000000000 / pwmclk) * 10; if (configuration->period < period_cmp) { - return RT_EINVAL; + return -RT_EINVAL; } period_cmp = (uint64_t)(1000000000 / (pwmclk / 65536 / 4)) * 65536; if (configuration->period > period_cmp) { - return RT_EINVAL; + return -RT_EINVAL; } period_cmp = (uint64_t) pwmclk * configuration->period / 1000000000; @@ -252,7 +252,7 @@ static rt_err_t gd32_pwm_control(struct rt_device_pwm *device, int cmd, void *ar case PWM_CMD_GET: return gd32_pwm_get(device, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_rtc.c b/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_rtc.c index 1bda274950..795d0b7167 100644 --- a/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_rtc.c +++ b/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_rtc.c @@ -127,7 +127,7 @@ static rt_err_t gd32_rtc_control(rt_device_t dev, int cmd, void *args) break; default: - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; diff --git a/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_wdt.c b/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_wdt.c index f0b340edac..820cc25989 100644 --- a/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_wdt.c +++ b/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_wdt.c @@ -124,7 +124,7 @@ static rt_err_t gd32_wdog_control(rt_watchdog_t *wdt, int cmd, void *args) } break; default: - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_bpwm.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_bpwm.c index 607b62f03b..defb016b1b 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_bpwm.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_bpwm.c @@ -205,7 +205,7 @@ static rt_err_t nu_bpwm_control(struct rt_device_pwm *device, int cmd, void *arg case PWM_CMD_GET: return nu_bpwm_get(device, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_pdma.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_pdma.c index 492c35ba5f..837e2c02d9 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_pdma.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_pdma.c @@ -284,7 +284,7 @@ exit_pdma_channel_terminate: static rt_err_t nu_pdma_timeout_set(int i32ChannID, int i32Timeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (!(nu_pdma_chn_mask & (1 << i32ChannID))) goto exit_nu_pdma_timeout_set; @@ -355,7 +355,7 @@ exit_nu_pdma_channel_allocate: rt_err_t nu_pdma_channel_free(int i32ChannID) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (! nu_pdma_inited) goto exit_nu_pdma_channel_free; @@ -373,7 +373,7 @@ exit_nu_pdma_channel_free: rt_err_t nu_pdma_callback_register(int i32ChannID, nu_pdma_cb_handler_t pfnHandler, void *pvUserData, uint32_t u32EventFilter) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (!(nu_pdma_chn_mask & (1 << i32ChannID))) goto exit_nu_pdma_callback_register; @@ -461,7 +461,7 @@ exit_nu_pdma_channel_memctrl_get: rt_err_t nu_pdma_channel_memctrl_set(int i32ChannID, nu_pdma_memctrl_t eMemCtrl) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; nu_pdma_chn_t *psPdmaChann = &nu_pdma_chn_arr[i32ChannID - NU_PDMA_CH_Pos]; @@ -518,7 +518,7 @@ rt_err_t nu_pdma_desc_setup(int i32ChannID, nu_pdma_desc_t dma_desc, uint32_t u3 uint32_t u32SrcCtl = 0; uint32_t u32DstCtl = 0; - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (!dma_desc) goto exit_nu_pdma_desc_setup; @@ -714,7 +714,7 @@ static void _nu_pdma_transfer(int i32ChannID, uint32_t u32Peripheral, nu_pdma_de rt_err_t nu_pdma_transfer(int i32ChannID, uint32_t u32DataWidth, uint32_t u32AddrSrc, uint32_t u32AddrDst, int32_t i32TransferCnt, uint32_t u32IdleTimeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; nu_pdma_periph_ctl_t *psPeriphCtl = NULL; @@ -744,7 +744,7 @@ exit_nu_pdma_transfer: rt_err_t nu_pdma_sg_transfer(int i32ChannID, nu_pdma_desc_t head, uint32_t u32IdleTimeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; nu_pdma_periph_ctl_t *psPeriphCtl = NULL; if (!head) diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_qspi.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_qspi.c index e8726de726..6fd9d2d8c9 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_qspi.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_qspi.c @@ -111,7 +111,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device, configuration->data_width == 24 || configuration->data_width == 32)) { - ret = RT_EINVAL; + ret = -RT_EINVAL; 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 bc8e1cdcca..37fc5bf03a 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_spi.c @@ -130,7 +130,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device, configuration->data_width == 24 || configuration->data_width == 32)) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_spi_bus_configure; } diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_timer.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_timer.c index ec2b1d72cb..64f3c6f92e 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_timer.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_timer.c @@ -191,7 +191,7 @@ static rt_err_t nu_timer_control(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg break; default: - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_uart.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_uart.c index c5943fd490..fec24a731f 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_uart.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_uart.c @@ -442,7 +442,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported data length\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } @@ -459,7 +459,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported stop bit\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } @@ -480,7 +480,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported parity\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_uspi.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_uspi.c index a8f726568e..d443db3c10 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_uspi.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_uspi.c @@ -168,7 +168,7 @@ static rt_err_t nu_uspi_bus_configure(struct rt_spi_device *device, if (!(configuration->data_width == 8 || configuration->data_width == 16)) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uspi_bus_configure; } diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_uuart.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_uuart.c index 6277c8054d..dfb530dc06 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_uuart.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_uuart.c @@ -224,7 +224,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria default: rt_kprintf("Unsupported data length"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uuart_configure; } @@ -241,7 +241,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria default: rt_kprintf("Unsupported stop bit"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uuart_configure; } @@ -262,7 +262,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria default: rt_kprintf("Unsupported parity"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uuart_configure; } /* Reset this module */ diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_wdt.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_wdt.c index fabcb92760..bba739a0fd 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_wdt.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_wdt.c @@ -371,7 +371,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (args == RT_NULL) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } @@ -385,7 +385,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (wanted_sec == 0) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } @@ -396,7 +396,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (args == RT_NULL) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_bpwm.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_bpwm.c index dd6a8b0692..c159f14577 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_bpwm.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_bpwm.c @@ -205,7 +205,7 @@ static rt_err_t nu_bpwm_control(struct rt_device_pwm *device, int cmd, void *arg case PWM_CMD_GET: return nu_bpwm_get(device, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_pdma.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_pdma.c index 35398a42ab..376e20cbdb 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_pdma.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_pdma.c @@ -285,7 +285,7 @@ exit_pdma_channel_terminate: static rt_err_t nu_pdma_timeout_set(int i32ChannID, int i32Timeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; PDMA_T *PDMA = NULL; if (!(nu_pdma_chn_mask & (1 << i32ChannID))) @@ -359,7 +359,7 @@ exit_nu_pdma_channel_allocate: rt_err_t nu_pdma_channel_free(int i32ChannID) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (! nu_pdma_inited) goto exit_nu_pdma_channel_free; @@ -377,7 +377,7 @@ exit_nu_pdma_channel_free: rt_err_t nu_pdma_callback_register(int i32ChannID, nu_pdma_cb_handler_t pfnHandler, void *pvUserData, uint32_t u32EventFilter) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (!(nu_pdma_chn_mask & (1 << i32ChannID))) goto exit_nu_pdma_callback_register; @@ -469,7 +469,7 @@ exit_nu_pdma_channel_memctrl_get: rt_err_t nu_pdma_channel_memctrl_set(int i32ChannID, nu_pdma_memctrl_t eMemCtrl) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; nu_pdma_chn_t *psPdmaChann = &nu_pdma_chn_arr[i32ChannID - NU_PDMA_CH_Pos]; @@ -527,7 +527,7 @@ rt_err_t nu_pdma_desc_setup(int i32ChannID, nu_pdma_desc_t dma_desc, uint32_t u3 uint32_t u32SrcCtl = 0; uint32_t u32DstCtl = 0; - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (!dma_desc) goto exit_nu_pdma_desc_setup; @@ -727,7 +727,7 @@ static void _nu_pdma_transfer(int i32ChannID, uint32_t u32Peripheral, nu_pdma_de rt_err_t nu_pdma_transfer(int i32ChannID, uint32_t u32DataWidth, uint32_t u32AddrSrc, uint32_t u32AddrDst, int32_t i32TransferCnt, uint32_t u32IdleTimeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; PDMA_T *PDMA = NU_PDMA_GET_BASE(i32ChannID); @@ -759,7 +759,7 @@ exit_nu_pdma_transfer: rt_err_t nu_pdma_sg_transfer(int i32ChannID, nu_pdma_desc_t head, uint32_t u32IdleTimeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; nu_pdma_periph_ctl_t *psPeriphCtl = NULL; if (!head) diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_qspi.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_qspi.c index 465be2fe52..8bb0f19c2e 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_qspi.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_qspi.c @@ -111,7 +111,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device, configuration->data_width == 24 || configuration->data_width == 32)) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_qspi_bus_configure; } diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_scuart.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_scuart.c index 3d83615002..5379a591a8 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_scuart.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_scuart.c @@ -213,7 +213,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, struct seri default: LOG_E("Unsupported data length"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } @@ -230,7 +230,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, struct seri default: LOG_E("Unsupported stop bit"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } @@ -251,7 +251,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, struct seri default: LOG_E("Unsupported parity"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.c index 0e2d1fcd00..17effc356a 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.c @@ -190,7 +190,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device, configuration->data_width == 24 || configuration->data_width == 32)) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_spi_bus_configure; } diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_timer.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_timer.c index b4d5472ee8..ebc11343ae 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_timer.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_timer.c @@ -198,7 +198,7 @@ static rt_err_t nu_timer_control(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg break; default: - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uart.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uart.c index 6c27efb396..120b9ea6e7 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uart.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uart.c @@ -396,7 +396,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported data length\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } @@ -413,7 +413,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported stop bit\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } @@ -434,7 +434,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported parity\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c index 0d0e57daf6..bc46a7709a 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c @@ -168,7 +168,7 @@ static rt_err_t nu_uspi_bus_configure(struct rt_spi_device *device, if (!(configuration->data_width == 8 || configuration->data_width == 16)) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uspi_bus_configure; } diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uuart.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uuart.c index 0317956b86..9a2dfd6280 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uuart.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uuart.c @@ -233,7 +233,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria default: rt_kprintf("Unsupported data length"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uuart_configure; } @@ -250,7 +250,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria default: rt_kprintf("Unsupported stop bit"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uuart_configure; } @@ -271,7 +271,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria default: rt_kprintf("Unsupported parity"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uuart_configure; } /* Reset this module */ diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_wdt.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_wdt.c index 13ff9c13b6..a7d3036ad5 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_wdt.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_wdt.c @@ -370,7 +370,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (args == RT_NULL) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } @@ -384,7 +384,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (wanted_sec == 0) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } @@ -395,7 +395,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (args == RT_NULL) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_dac.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_dac.c index de19d6f8a3..a3b2b1d491 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_dac.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_dac.c @@ -118,7 +118,7 @@ static rt_err_t nu_dac_convert(struct rt_dac_device *device, rt_uint32_t channel if (channel >= psNuDAC->max_chn_num) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_dac_convert; } diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_eadc.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_eadc.c index 8ad2c11745..25259639d5 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_eadc.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_eadc.c @@ -131,7 +131,7 @@ static rt_err_t nu_get_eadc_value(struct rt_adc_device *device, rt_uint32_t chan if (channel >= psNuEADC->max_chn_num) { *value = 0xFFFFFFFF; - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_get_eadc_value; } diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_pdma.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_pdma.c index f0a931a9a4..c2d4bbb93f 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_pdma.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_pdma.c @@ -341,7 +341,7 @@ exit_pdma_channel_terminate: static rt_err_t nu_pdma_timeout_set(int i32ChannID, int i32Timeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; PDMA_T *PDMA = NULL; uint32_t u32ModChannId; @@ -425,7 +425,7 @@ exit_nu_pdma_channel_allocate: rt_err_t nu_pdma_channel_free(int i32ChannID) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (! nu_pdma_inited) goto exit_nu_pdma_channel_free; @@ -446,7 +446,7 @@ exit_nu_pdma_channel_free: rt_err_t nu_pdma_filtering_set(int i32ChannID, uint32_t u32EventFilter) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (nu_pdma_check_is_nonallocated(i32ChannID)) goto exit_nu_pdma_filtering_set; @@ -473,7 +473,7 @@ exit_nu_pdma_filtering_get: rt_err_t nu_pdma_callback_register(int i32ChannID, nu_pdma_chn_cb_t psChnCb) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; nu_pdma_chn_cb_t psChnCb_Current = RT_NULL; RT_ASSERT(psChnCb != RT_NULL); @@ -595,7 +595,7 @@ exit_nu_pdma_channel_memctrl_get: rt_err_t nu_pdma_channel_memctrl_set(int i32ChannID, nu_pdma_memctrl_t eMemCtrl) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; nu_pdma_chn_t *psPdmaChann = &nu_pdma_chn_arr[i32ChannID - NU_PDMA_CH_Pos]; if (nu_pdma_check_is_nonallocated(i32ChannID)) @@ -652,7 +652,7 @@ rt_err_t nu_pdma_desc_setup(int i32ChannID, nu_pdma_desc_t dma_desc, uint32_t u3 uint32_t u32SrcCtl = 0; uint32_t u32DstCtl = 0; - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (!dma_desc) goto exit_nu_pdma_desc_setup; @@ -925,7 +925,7 @@ exit__nu_pdma_transfer_chain: rt_err_t nu_pdma_transfer(int i32ChannID, uint32_t u32DataWidth, uint32_t u32AddrSrc, uint32_t u32AddrDst, uint32_t u32TransferCnt, uint32_t u32IdleTimeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; PDMA_T *PDMA = NU_PDMA_GET_BASE(i32ChannID); nu_pdma_desc_t head; nu_pdma_chn_t *psPdmaChann; @@ -966,7 +966,7 @@ exit_nu_pdma_transfer: rt_err_t nu_pdma_sg_transfer(int i32ChannID, nu_pdma_desc_t head, uint32_t u32IdleTimeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; nu_pdma_periph_ctl_t *psPeriphCtl = NULL; if (!head) diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_qspi.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_qspi.c index 700a143251..58fc464405 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_qspi.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_qspi.c @@ -129,7 +129,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device, configuration->data_width == 24 || configuration->data_width == 32)) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_qspi_bus_configure; } diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_scuart.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_scuart.c index daa4df9123..256d92d1a2 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_scuart.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_scuart.c @@ -186,7 +186,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, default: LOG_E("Unsupported data length\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } @@ -203,7 +203,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, default: LOG_E("Unsupported stop bit\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } @@ -224,7 +224,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, default: LOG_E("Unsupported parity\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_spi.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_spi.c index 1d05afe9e9..1e547d9ce7 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_spi.c @@ -334,7 +334,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device, configuration->data_width == 24 || configuration->data_width == 32)) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_spi_bus_configure; } diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_timer.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_timer.c index e6fa0fe6d8..b9f4c7bbea 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_timer.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_timer.c @@ -122,7 +122,7 @@ static void nu_timer_init(rt_hwtimer_t *timer, rt_uint32_t state) static rt_err_t nu_timer_start(rt_hwtimer_t *timer, rt_uint32_t cnt, rt_hwtimer_mode_t opmode) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; rt_uint32_t u32OpMode; nu_timer_t psNuTmr = NU_TIMER_DEVICE(timer); @@ -205,7 +205,7 @@ static rt_err_t nu_timer_control(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg break; default: - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_uart.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_uart.c index 153e8abee6..937154851b 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_uart.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_uart.c @@ -577,7 +577,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported data length\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } @@ -594,7 +594,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported stop bit\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } @@ -615,7 +615,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported parity\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_uspi.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_uspi.c index 213c839902..6317e0702e 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_uspi.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_uspi.c @@ -147,7 +147,7 @@ static rt_err_t nu_uspi_bus_configure(struct rt_spi_device *device, if (!(configuration->data_width == 8 || configuration->data_width == 16)) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uspi_bus_configure; } diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_uuart.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_uuart.c index a0a138a019..11fc59e3e5 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_uuart.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_uuart.c @@ -196,7 +196,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria default: rt_kprintf("Unsupported data length"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uuart_configure; } @@ -213,7 +213,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria default: rt_kprintf("Unsupported stop bit\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uuart_configure; } @@ -234,7 +234,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria default: rt_kprintf("Unsupported parity\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uuart_configure; } /* Reset this module */ diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_wdt.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_wdt.c index 367ab63a45..1168fd9bff 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_wdt.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_wdt.c @@ -385,7 +385,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (args == RT_NULL) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } @@ -399,7 +399,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (wanted_sec == 0) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } @@ -410,7 +410,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (args == RT_NULL) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_bpwm.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_bpwm.c index 14c0b89479..b192871b4a 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_bpwm.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_bpwm.c @@ -205,7 +205,7 @@ static rt_err_t nu_bpwm_control(struct rt_device_pwm *device, int cmd, void *arg case PWM_CMD_GET: return nu_bpwm_get(device, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_pdma.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_pdma.c index 8fb4cca738..6248605995 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_pdma.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_pdma.c @@ -314,7 +314,7 @@ exit_pdma_channel_terminate: static rt_err_t nu_pdma_timeout_set(int i32ChannID, int i32Timeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (!(nu_pdma_chn_mask & (1 << i32ChannID))) goto exit_nu_pdma_timeout_set; @@ -385,7 +385,7 @@ exit_nu_pdma_channel_allocate: rt_err_t nu_pdma_channel_free(int i32ChannID) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (! nu_pdma_inited) goto exit_nu_pdma_channel_free; @@ -403,7 +403,7 @@ exit_nu_pdma_channel_free: rt_err_t nu_pdma_callback_register(int i32ChannID, nu_pdma_cb_handler_t pfnHandler, void *pvUserData, uint32_t u32EventFilter) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (!(nu_pdma_chn_mask & (1 << i32ChannID))) goto exit_nu_pdma_callback_register; @@ -491,7 +491,7 @@ exit_nu_pdma_channel_memctrl_get: rt_err_t nu_pdma_channel_memctrl_set(int i32ChannID, nu_pdma_memctrl_t eMemCtrl) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; nu_pdma_chn_t *psPdmaChann = &nu_pdma_chn_arr[i32ChannID - NU_PDMA_CH_Pos]; @@ -548,7 +548,7 @@ rt_err_t nu_pdma_desc_setup(int i32ChannID, nu_pdma_desc_t dma_desc, uint32_t u3 uint32_t u32SrcCtl = 0; uint32_t u32DstCtl = 0; - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (!dma_desc) goto exit_nu_pdma_desc_setup; @@ -744,7 +744,7 @@ static void _nu_pdma_transfer(int i32ChannID, uint32_t u32Peripheral, nu_pdma_de rt_err_t nu_pdma_transfer(int i32ChannID, uint32_t u32DataWidth, uint32_t u32AddrSrc, uint32_t u32AddrDst, int32_t i32TransferCnt, uint32_t u32IdleTimeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; nu_pdma_periph_ctl_t *psPeriphCtl = NULL; @@ -774,7 +774,7 @@ exit_nu_pdma_transfer: rt_err_t nu_pdma_sg_transfer(int i32ChannID, nu_pdma_desc_t head, uint32_t u32IdleTimeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; nu_pdma_periph_ctl_t *psPeriphCtl = NULL; if (!head) diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_qspi.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_qspi.c index fe7624b6f4..b60f49eef4 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_qspi.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_qspi.c @@ -130,7 +130,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device, configuration->data_width == 24 || configuration->data_width == 32)) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_qspi_bus_configure; } diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_scuart.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_scuart.c index 708435fef4..6090f9f8df 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_scuart.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_scuart.c @@ -213,7 +213,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, default: LOG_E("Unsupported data length"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } @@ -230,7 +230,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, default: LOG_E("Unsupported stop bit"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } @@ -251,7 +251,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, default: LOG_E("Unsupported parity"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_spi.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_spi.c index ce29d62347..254364ad62 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_spi.c @@ -190,7 +190,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device, configuration->data_width == 24 || configuration->data_width == 32)) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_spi_bus_configure; } diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_timer.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_timer.c index 456cbbc34a..37b885a093 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_timer.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_timer.c @@ -190,7 +190,7 @@ static rt_err_t nu_timer_control(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg break; default: - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_uart.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_uart.c index 64b7f1dac0..72574d26b9 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_uart.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_uart.c @@ -474,7 +474,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported data length\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } @@ -491,7 +491,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported stop bit\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } @@ -512,7 +512,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported parity\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c index f724a0ec20..6910085020 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c @@ -168,7 +168,7 @@ static rt_err_t nu_uspi_bus_configure(struct rt_spi_device *device, if (!(configuration->data_width == 8 || configuration->data_width == 16)) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uspi_bus_configure; } diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_uuart.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_uuart.c index 925b86ffad..d5772cb295 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_uuart.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_uuart.c @@ -233,7 +233,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria default: rt_kprintf("Unsupported data length"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uuart_configure; } @@ -250,7 +250,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria default: rt_kprintf("Unsupported stop bit"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uuart_configure; } @@ -271,7 +271,7 @@ static rt_err_t nu_uuart_configure(struct rt_serial_device *serial, struct seria default: rt_kprintf("Unsupported parity"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uuart_configure; } /* Reset this module */ diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_wdt.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_wdt.c index ffe5f98a1a..d9bc0b3940 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_wdt.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_wdt.c @@ -367,7 +367,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (args == RT_NULL) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } @@ -381,7 +381,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (wanted_sec == 0) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } @@ -392,7 +392,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (args == RT_NULL) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/drv_adc.c b/bsp/nuvoton/libraries/ma35/rtt_port/drv_adc.c index 1156803603..4514b613c6 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/drv_adc.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/drv_adc.c @@ -329,7 +329,7 @@ static void nu_adc_touch_smpl(void *p) static rt_err_t _nu_adc_control(rt_device_t dev, int cmd, void *args) { - rt_err_t ret = RT_EINVAL ; + rt_err_t ret = -RT_EINVAL ; nu_adc_t psNuAdc = (nu_adc_t)dev; ADC_T *adc = psNuAdc->base; @@ -563,7 +563,7 @@ static rt_err_t nu_adc_convert(struct rt_adc_device *device, rt_uint32_t channel if (channel >= ADC_CH_NUM) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_adc_convert; } else if ((ret = _nu_adc_control((rt_device_t)device, SWITCH_CH, (void *)channel)) != RT_EOK) diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/drv_pdma.c b/bsp/nuvoton/libraries/ma35/rtt_port/drv_pdma.c index 2304107cd3..b377672e81 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/drv_pdma.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/drv_pdma.c @@ -330,7 +330,7 @@ static inline void nu_pdma_channel_reset(int i32ChannID) static rt_err_t nu_pdma_timeout_set(int i32ChannID, int i32Timeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; PDMA_T *PDMA = NULL; uint32_t u32ModChannId; @@ -435,7 +435,7 @@ exit_nu_pdma_channel_allocate: rt_err_t nu_pdma_channel_free(int i32ChannID) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (! nu_pdma_inited) goto exit_nu_pdma_channel_free; @@ -456,7 +456,7 @@ exit_nu_pdma_channel_free: rt_err_t nu_pdma_filtering_set(int i32ChannID, uint32_t u32EventFilter) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (nu_pdma_check_is_nonallocated(i32ChannID)) goto exit_nu_pdma_filtering_set; @@ -483,7 +483,7 @@ exit_nu_pdma_filtering_get: rt_err_t nu_pdma_callback_register(int i32ChannID, nu_pdma_chn_cb_t psChnCb) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; nu_pdma_chn_cb_t psChnCb_Current = RT_NULL; RT_ASSERT(psChnCb != RT_NULL); @@ -630,7 +630,7 @@ exit_nu_pdma_channel_memctrl_get: rt_err_t nu_pdma_channel_memctrl_set(int i32ChannID, nu_pdma_memctrl_t eMemCtrl) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; nu_pdma_chn_t *psPdmaChann = &nu_pdma_chn_arr[i32ChannID - NU_PDMA_CH_Pos]; if (nu_pdma_check_is_nonallocated(i32ChannID)) @@ -686,7 +686,7 @@ rt_err_t nu_pdma_desc_setup(int i32ChannID, nu_pdma_desc_t dma_desc, uint32_t u3 uint32_t u32SrcCtl = 0; uint32_t u32DstCtl = 0; - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (!dma_desc) goto exit_nu_pdma_desc_setup; @@ -949,7 +949,7 @@ exit__nu_pdma_transfer_chain: rt_err_t nu_pdma_transfer(int i32ChannID, uint32_t u32DataWidth, uint32_t u32AddrSrc, uint32_t u32AddrDst, uint32_t u32TransferCnt, uint32_t u32IdleTimeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; PDMA_T *PDMA = NU_PDMA_GET_BASE(i32ChannID); nu_pdma_desc_t head; nu_pdma_chn_t *psPdmaChann; @@ -990,7 +990,7 @@ exit_nu_pdma_transfer: rt_err_t nu_pdma_sg_transfer(int i32ChannID, nu_pdma_desc_t head, uint32_t u32IdleTimeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; nu_pdma_periph_ctl_t *psPeriphCtl = NULL; if (!head) diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/drv_qspi.c b/bsp/nuvoton/libraries/ma35/rtt_port/drv_qspi.c index 96cc4de799..45288cc032 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/drv_qspi.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/drv_qspi.c @@ -128,7 +128,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device, configuration->data_width == 24 || configuration->data_width == 32)) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_qspi_bus_configure; } diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/drv_scuart.c b/bsp/nuvoton/libraries/ma35/rtt_port/drv_scuart.c index a0541c360c..75a89f4bee 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/drv_scuart.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/drv_scuart.c @@ -146,7 +146,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, default: LOG_E("Unsupported data length"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } @@ -163,7 +163,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, default: LOG_E("Unsupported stop bit"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } @@ -184,7 +184,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, default: LOG_E("Unsupported parity"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/drv_spi.c b/bsp/nuvoton/libraries/ma35/rtt_port/drv_spi.c index d4ff0621f9..9146e25d51 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/drv_spi.c @@ -185,7 +185,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device, configuration->data_width == 24 || configuration->data_width == 32)) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_spi_bus_configure; } diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/drv_timer.c b/bsp/nuvoton/libraries/ma35/rtt_port/drv_timer.c index 5b98e49718..fe590fec3b 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/drv_timer.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/drv_timer.c @@ -171,7 +171,7 @@ static void nu_timer_init(rt_hwtimer_t *timer, rt_uint32_t state) static rt_err_t nu_timer_start(rt_hwtimer_t *timer, rt_uint32_t cnt, rt_hwtimer_mode_t opmode) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; rt_uint32_t u32OpMode; nu_timer_t psNuTmr = NU_TIMER_DEVICE(timer); @@ -254,7 +254,7 @@ static rt_err_t nu_timer_control(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg break; default: - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/drv_uart.c b/bsp/nuvoton/libraries/ma35/rtt_port/drv_uart.c index 8c388b09ac..e3c2073118 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/drv_uart.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/drv_uart.c @@ -639,7 +639,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: LOG_E("Unsupported data length."); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } @@ -656,7 +656,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: LOG_E("Unsupported stop bit."); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } @@ -677,7 +677,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: LOG_E("Unsupported parity."); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/drv_wdt.c b/bsp/nuvoton/libraries/ma35/rtt_port/drv_wdt.c index cbacf45e9c..5c2ccb18cc 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/drv_wdt.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/drv_wdt.c @@ -257,7 +257,7 @@ static rt_err_t nu_wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (args == RT_NULL) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } @@ -269,7 +269,7 @@ static rt_err_t nu_wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (args == RT_NULL) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } @@ -277,7 +277,7 @@ static rt_err_t nu_wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (wanted_sec == 0) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } @@ -289,7 +289,7 @@ static rt_err_t nu_wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (args == RT_NULL) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_adc.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_adc.c index eea201ea69..cf3a4f5e0c 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_adc.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_adc.c @@ -330,7 +330,7 @@ static void nu_adc_touch_smpl(void *p) static rt_err_t _nu_adc_control(rt_device_t dev, int cmd, void *args) { - rt_err_t ret = RT_EINVAL ; + rt_err_t ret = -RT_EINVAL ; nu_adc_t psNuAdc = (nu_adc_t)dev; ADC_T *adc = psNuAdc->base; @@ -564,7 +564,7 @@ static rt_err_t nu_adc_convert(struct rt_adc_device *device, rt_uint32_t channel if (channel >= ADC_CH_NUM) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_adc_convert; } else if ((ret = _nu_adc_control((rt_device_t)device, SWITCH_CH, (void *)channel)) != RT_EOK) diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_etimer.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_etimer.c index 7c3b1578e4..e132600f95 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_etimer.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_etimer.c @@ -147,7 +147,7 @@ static void nu_etimer_init(rt_hwtimer_t *timer, rt_uint32_t state) static rt_err_t nu_etimer_start(rt_hwtimer_t *timer, rt_uint32_t cnt, rt_hwtimer_mode_t opmode) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; rt_uint32_t u32OpMode; nu_etimer_t psNuETmr = NU_TIMER_DEVICE(timer); @@ -230,7 +230,7 @@ static rt_err_t nu_etimer_control(rt_hwtimer_t *timer, rt_uint32_t cmd, void *ar break; default: - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_pwm.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_pwm.c index ce77b21aa8..f5278d63b9 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_pwm.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_pwm.c @@ -223,7 +223,7 @@ uint32_t nu_pwm_config(uint32_t u32PwmBaseAddr, uint32_t u32ChannelNum, uint32_t static rt_err_t nu_pwm_set(struct rt_device_pwm *device, struct rt_pwm_configuration *config) { nu_pwm_t psNuPWM = (nu_pwm_t)device; - rt_err_t result = RT_EINVAL; + rt_err_t result = -RT_EINVAL; rt_uint32_t u32FreqInHz; /* unit:Hz */ rt_uint32_t u32PulseInHz; /* unit:% */ diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_qspi.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_qspi.c index 9112677834..e0fb3a7f8b 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_qspi.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_qspi.c @@ -137,7 +137,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device, configuration->data_width == 24 || configuration->data_width == 32)) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_qspi_bus_configure; } diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_scuart.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_scuart.c index ddf9f5f045..51258de5e6 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_scuart.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_scuart.c @@ -156,7 +156,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, default: LOG_E("Unsupported data length"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } @@ -173,7 +173,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, default: LOG_E("Unsupported stop bit"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } @@ -194,7 +194,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, default: LOG_E("Unsupported parity"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_timer.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_timer.c index 946da8a6f1..38ea1b9e49 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_timer.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_timer.c @@ -150,7 +150,7 @@ static void nu_timer_init(rt_hwtimer_t *timer, rt_uint32_t state) static rt_err_t nu_timer_start(rt_hwtimer_t *timer, rt_uint32_t cnt, rt_hwtimer_mode_t opmode) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; rt_uint32_t u32OpMode; nu_timer_t psNuTmr = NU_TIMER_DEVICE(timer); @@ -233,7 +233,7 @@ static rt_err_t nu_timer_control(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg break; default: - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_uart.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_uart.c index ca7a03e8e3..05ae7e5f3c 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_uart.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_uart.c @@ -300,7 +300,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported data length"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } @@ -317,7 +317,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported stop bit"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } @@ -338,7 +338,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported parity"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_wdt.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_wdt.c index cc77bd2b30..212a71fbc2 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_wdt.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_wdt.c @@ -179,7 +179,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (args == RT_NULL) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } @@ -193,7 +193,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (wanted_sec == 0) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } @@ -204,7 +204,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (args == RT_NULL) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/nuvoton/libraries/nu_packages/SPINAND/spinand.c b/bsp/nuvoton/libraries/nu_packages/SPINAND/spinand.c index d9f4628299..1f6caeab08 100644 --- a/bsp/nuvoton/libraries/nu_packages/SPINAND/spinand.c +++ b/bsp/nuvoton/libraries/nu_packages/SPINAND/spinand.c @@ -381,7 +381,7 @@ static rt_err_t spinand_status_register_write(struct rt_qspi_device *qspi, uint8 break; default: - result = RT_EINVAL; + result = -RT_EINVAL; goto exit_spinand_status_register_write; } diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_adc.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_adc.c index eea201ea69..cf3a4f5e0c 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_adc.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_adc.c @@ -330,7 +330,7 @@ static void nu_adc_touch_smpl(void *p) static rt_err_t _nu_adc_control(rt_device_t dev, int cmd, void *args) { - rt_err_t ret = RT_EINVAL ; + rt_err_t ret = -RT_EINVAL ; nu_adc_t psNuAdc = (nu_adc_t)dev; ADC_T *adc = psNuAdc->base; @@ -564,7 +564,7 @@ static rt_err_t nu_adc_convert(struct rt_adc_device *device, rt_uint32_t channel if (channel >= ADC_CH_NUM) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_adc_convert; } else if ((ret = _nu_adc_control((rt_device_t)device, SWITCH_CH, (void *)channel)) != RT_EOK) diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_etimer.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_etimer.c index cf7ff232cd..93942edd54 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_etimer.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_etimer.c @@ -161,7 +161,7 @@ static void nu_etimer_init(rt_hwtimer_t *timer, rt_uint32_t state) static rt_err_t nu_etimer_start(rt_hwtimer_t *timer, rt_uint32_t cnt, rt_hwtimer_mode_t opmode) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; rt_uint32_t u32OpMode; nu_etimer_t psNuETmr = NU_TIMER_DEVICE(timer); @@ -244,7 +244,7 @@ static rt_err_t nu_etimer_control(rt_hwtimer_t *timer, rt_uint32_t cmd, void *ar break; default: - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_pdma.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_pdma.c index 4468a6744b..3448360855 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_pdma.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_pdma.c @@ -249,7 +249,7 @@ exit_pdma_channel_terminate: static rt_err_t nu_pdma_timeout_set(int i32ChannID, int i32Timeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; PDMA_T *PDMA = NULL; if (!(nu_pdma_chn_mask & (1 << i32ChannID))) @@ -325,7 +325,7 @@ exit_nu_pdma_channel_allocate: rt_err_t nu_pdma_channel_free(int i32ChannID) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (! nu_pdma_inited) goto exit_nu_pdma_channel_free; @@ -343,7 +343,7 @@ exit_nu_pdma_channel_free: rt_err_t nu_pdma_filtering_set(int i32ChannID, uint32_t u32EventFilter) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (!(nu_pdma_chn_mask & (1 << i32ChannID))) goto exit_nu_pdma_filtering_set; @@ -370,7 +370,7 @@ exit_nu_pdma_filtering_get: rt_err_t nu_pdma_callback_register(int i32ChannID, nu_pdma_chn_cb_t psChnCb) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; nu_pdma_chn_cb_t psChnCb_Current = RT_NULL; RT_ASSERT(psChnCb != RT_NULL); @@ -490,7 +490,7 @@ exit_nu_pdma_channel_memctrl_get: rt_err_t nu_pdma_channel_memctrl_set(int i32ChannID, nu_pdma_memctrl_t eMemCtrl) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; nu_pdma_chn_t *psPdmaChann = &nu_pdma_chn_arr[i32ChannID - NU_PDMA_CH_Pos]; @@ -548,7 +548,7 @@ rt_err_t nu_pdma_desc_setup(int i32ChannID, nu_pdma_desc_t dma_desc, uint32_t u3 uint32_t u32SrcCtl = 0; uint32_t u32DstCtl = 0; - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; if (!dma_desc) goto exit_nu_pdma_desc_setup; @@ -801,7 +801,7 @@ exit__nu_pdma_transfer_chain: rt_err_t nu_pdma_transfer(int i32ChannID, uint32_t u32DataWidth, uint32_t u32AddrSrc, uint32_t u32AddrDst, uint32_t u32TransferCnt, uint32_t u32IdleTimeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; PDMA_T *PDMA = NU_PDMA_GET_BASE(i32ChannID); nu_pdma_desc_t head; nu_pdma_chn_t *psPdmaChann; @@ -842,7 +842,7 @@ exit_nu_pdma_transfer: rt_err_t nu_pdma_sg_transfer(int i32ChannID, nu_pdma_desc_t head, uint32_t u32IdleTimeout_us) { - rt_err_t ret = RT_EINVAL; + rt_err_t ret = -RT_EINVAL; nu_pdma_periph_ctl_t *psPeriphCtl = NULL; if (!head) diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_pwm.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_pwm.c index 9ebdfa518e..ab9222cf4e 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_pwm.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_pwm.c @@ -234,7 +234,7 @@ uint32_t nu_pwm_config(uint32_t u32PwmBaseAddr, uint32_t u32ChannelNum, uint32_t static rt_err_t nu_pwm_set(struct rt_device_pwm *device, struct rt_pwm_configuration *config) { nu_pwm_t psNuPWM = (nu_pwm_t)device; - rt_err_t result = RT_EINVAL; + rt_err_t result = -RT_EINVAL; rt_uint32_t u32FreqInHz; /* unit:Hz */ rt_uint32_t u32PulseInHz; /* unit:% */ diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_qspi.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_qspi.c index 39108bbb72..186ba5d976 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_qspi.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_qspi.c @@ -111,7 +111,7 @@ static rt_err_t nu_qspi_bus_configure(struct rt_spi_device *device, configuration->data_width == 24 || configuration->data_width == 32)) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_qspi_bus_configure; } diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_scuart.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_scuart.c index 6867eb8827..c8fe989bd5 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_scuart.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_scuart.c @@ -156,7 +156,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, default: LOG_E("Unsupported data length"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } @@ -173,7 +173,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, default: LOG_E("Unsupported stop bit"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } @@ -194,7 +194,7 @@ static rt_err_t nu_scuart_configure(struct rt_serial_device *serial, default: LOG_E("Unsupported parity"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_scuart_configure; } diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.c index 7c1db7cf85..b3b764f724 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.c @@ -155,7 +155,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device, configuration->data_width == 24 || configuration->data_width == 32)) { - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_spi_bus_configure; } diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.c index afb1c75f7c..29be15e9e0 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.c @@ -464,7 +464,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported data length\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } @@ -481,7 +481,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported stop bit\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } @@ -502,7 +502,7 @@ static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial default: rt_kprintf("Unsupported parity\n"); - ret = RT_EINVAL; + ret = -RT_EINVAL; goto exit_nu_uart_configure; } diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_wdt.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_wdt.c index d5b696c59f..d9a1ed6bd0 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_wdt.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_wdt.c @@ -305,7 +305,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (args == RT_NULL) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } @@ -319,7 +319,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (wanted_sec == 0) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } @@ -330,7 +330,7 @@ static rt_err_t wdt_control(rt_watchdog_t *dev, int cmd, void *args) if (args == RT_NULL) { - ret = RT_EINVAL; + ret = -RT_EINVAL; break; } diff --git a/bsp/qemu-virt64-aarch64/drivers/drv_rtc.c b/bsp/qemu-virt64-aarch64/drivers/drv_rtc.c index 2b26429dcf..019c5d5b0e 100644 --- a/bsp/qemu-virt64-aarch64/drivers/drv_rtc.c +++ b/bsp/qemu-virt64-aarch64/drivers/drv_rtc.c @@ -73,7 +73,7 @@ static rt_err_t pl031_rtc_control(rt_device_t dev, int cmd, void *args) pl031_write32(RTC_LR, *(time_t *)args); break; default: - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; } diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_rtc.c b/bsp/raspberry-pi/raspi3-32/driver/drv_rtc.c index 0b465b5763..e050dd93d8 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_rtc.c +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_rtc.c @@ -244,7 +244,7 @@ static rt_err_t raspi_rtc_control(rt_device_t dev, int cmd, void *args) raspi_set_timestamp(*(time_t *)args); break; default: - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; } diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.c b/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.c index d772614971..f6625f025a 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.c +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.c @@ -88,7 +88,7 @@ static rt_err_t raspi_rtc_control(rt_device_t dev, int cmd, void *args) raspi_set_timestamp(*(time_t *)args); break; default: - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; } diff --git a/bsp/rockchip/common/drivers/drv_gpio.c b/bsp/rockchip/common/drivers/drv_gpio.c index 2fda98765a..860290cbc7 100644 --- a/bsp/rockchip/common/drivers/drv_gpio.c +++ b/bsp/rockchip/common/drivers/drv_gpio.c @@ -191,7 +191,7 @@ static rt_err_t pin_irq_enable(struct rt_device *dev, rt_base_t pin, rt_uint32_t break; default: rt_hw_interrupt_enable(level); - return RT_EINVAL; + return -RT_EINVAL; } HAL_GPIO_SetIntType(get_st_gpio(pin), get_st_pin(pin), mode); diff --git a/bsp/synwit/swm320/drivers/drv_gpio.c b/bsp/synwit/swm320/drivers/drv_gpio.c index d22dd8be2a..0c040b5aa4 100644 --- a/bsp/synwit/swm320/drivers/drv_gpio.c +++ b/bsp/synwit/swm320/drivers/drv_gpio.c @@ -412,7 +412,7 @@ static rt_err_t swm_pin_irq_enable(struct rt_device *device, EXTI_Init(gpio_obj->gpio, gpio_obj->pin, EXTI_LOW_LEVEL); break; default: - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); diff --git a/bsp/synwit/swm320/drivers/drv_pwm.c b/bsp/synwit/swm320/drivers/drv_pwm.c index 6495340deb..546d4cddc4 100644 --- a/bsp/synwit/swm320/drivers/drv_pwm.c +++ b/bsp/synwit/swm320/drivers/drv_pwm.c @@ -291,7 +291,7 @@ static rt_err_t swm_pwm_control(struct rt_device_pwm *pwm_device, int cmd, void case PWM_CMD_GET: return swm_pwm_get(pwm_device, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/synwit/swm320/drivers/drv_spi.c b/bsp/synwit/swm320/drivers/drv_spi.c index 64eec472af..df8120d436 100644 --- a/bsp/synwit/swm320/drivers/drv_spi.c +++ b/bsp/synwit/swm320/drivers/drv_spi.c @@ -116,7 +116,7 @@ static rt_err_t swm_spi_configure(struct rt_spi_device *device, if (configure->mode & RT_SPI_3WIRE) { - return RT_EINVAL; + return -RT_EINVAL; } if (configure->data_width == 8) diff --git a/bsp/synwit/swm341/drivers/drv_gpio.c b/bsp/synwit/swm341/drivers/drv_gpio.c index c0abfe10c4..d38a80eede 100644 --- a/bsp/synwit/swm341/drivers/drv_gpio.c +++ b/bsp/synwit/swm341/drivers/drv_gpio.c @@ -434,7 +434,7 @@ static rt_err_t swm_pin_irq_enable(struct rt_device *device, EXTI_Init(gpio_obj->gpio, gpio_obj->pin, EXTI_LOW_LEVEL); break; default: - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); diff --git a/bsp/synwit/swm341/drivers/drv_pwm.c b/bsp/synwit/swm341/drivers/drv_pwm.c index 6306fa7312..2e9c9837d8 100644 --- a/bsp/synwit/swm341/drivers/drv_pwm.c +++ b/bsp/synwit/swm341/drivers/drv_pwm.c @@ -295,7 +295,7 @@ static rt_err_t swm_pwm_control(struct rt_device_pwm *pwm_device, int cmd, void case PWM_CMD_GET: return swm_pwm_get(pwm_device, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/synwit/swm341/drivers/drv_spi.c b/bsp/synwit/swm341/drivers/drv_spi.c index 5cff92936e..3a1ad69848 100644 --- a/bsp/synwit/swm341/drivers/drv_spi.c +++ b/bsp/synwit/swm341/drivers/drv_spi.c @@ -118,7 +118,7 @@ static rt_err_t swm_spi_configure(struct rt_spi_device *device, if (configure->mode & RT_SPI_3WIRE) { - return RT_EINVAL; + return -RT_EINVAL; } if (configure->data_width == 8) diff --git a/bsp/ti/c28x/libraries/HAL_Drivers/drv_pwm.c b/bsp/ti/c28x/libraries/HAL_Drivers/drv_pwm.c index 336e7f6e57..d05e9d6668 100644 --- a/bsp/ti/c28x/libraries/HAL_Drivers/drv_pwm.c +++ b/bsp/ti/c28x/libraries/HAL_Drivers/drv_pwm.c @@ -348,7 +348,7 @@ static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg case PWM_CMD_DISABLE_IRQ: return drv_pwm_enable_irq((struct EPWM_REGS *)(pwm->pwm_regs), RT_FALSE); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/tm4c123bsp/libraries/Drivers/drv_pwm.c b/bsp/tm4c123bsp/libraries/Drivers/drv_pwm.c index d365899a4d..345a5bd2c8 100644 --- a/bsp/tm4c123bsp/libraries/Drivers/drv_pwm.c +++ b/bsp/tm4c123bsp/libraries/Drivers/drv_pwm.c @@ -231,7 +231,7 @@ static rt_err_t tm4c123_pwm_control(struct rt_device_pwm *device, int cmd, void case PWM_CMD_GET: return drv_pwm_get(device->parent.parent.name, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/w60x/drivers/drv_pwm.c b/bsp/w60x/drivers/drv_pwm.c index 9d73228ee2..07a9c3f661 100644 --- a/bsp/w60x/drivers/drv_pwm.c +++ b/bsp/w60x/drivers/drv_pwm.c @@ -113,7 +113,7 @@ static rt_err_t wm_pwm_control(struct rt_device_pwm *device, int cmd, void *arg) channel = configuration->channel - 1; if (channel > 4) - return RT_EINVAL; + return -RT_EINVAL; switch (cmd) { @@ -134,7 +134,7 @@ static rt_err_t wm_pwm_control(struct rt_device_pwm *device, int cmd, void *arg) case PWM_CMD_GET: return wm_pwm_get(channel, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/w60x/drivers/drv_rtc.c b/bsp/w60x/drivers/drv_rtc.c index 500201b68d..13fc00ea99 100644 --- a/bsp/w60x/drivers/drv_rtc.c +++ b/bsp/w60x/drivers/drv_rtc.c @@ -154,7 +154,7 @@ static rt_err_t wm_rtc_control(rt_device_t dev, int cmd, void *args) break; #endif default: - return RT_EINVAL; + return -RT_EINVAL; } return RT_EOK; } diff --git a/bsp/w60x/drivers/drv_wifi.c b/bsp/w60x/drivers/drv_wifi.c index b7bc9eb459..5d6fb1b643 100644 --- a/bsp/w60x/drivers/drv_wifi.c +++ b/bsp/w60x/drivers/drv_wifi.c @@ -485,7 +485,7 @@ static rt_err_t drv_wlan_cfg_filter(struct rt_wlan_device *wlan, struct rt_wlan_ { LOG_D("F:%s L:%d", __FUNCTION__, __LINE__); - return RT_EINVAL;/* not support */ + return -RT_EINVAL;/* not support */ } static rt_err_t drv_wlan_set_channel(struct rt_wlan_device *wlan, int channel) diff --git a/bsp/wch/arm/Libraries/ch32_drivers/drv_gpio_ch32f10x.c b/bsp/wch/arm/Libraries/ch32_drivers/drv_gpio_ch32f10x.c index 02a460e6d5..3bc934fc7b 100644 --- a/bsp/wch/arm/Libraries/ch32_drivers/drv_gpio_ch32f10x.c +++ b/bsp/wch/arm/Libraries/ch32_drivers/drv_gpio_ch32f10x.c @@ -367,12 +367,12 @@ rt_err_t ch32f1_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint8 find = exti_line_irq_list_find(pin); if (find == RT_NULL) - return RT_EINVAL; + return -RT_EINVAL; item = pin_info_list_find(pin); if (item == RT_NULL) - return RT_EINVAL; + return -RT_EINVAL; if (enabled == PIN_IRQ_ENABLE) { diff --git a/bsp/wch/arm/Libraries/ch32_drivers/drv_gpio_ch32f20x.c b/bsp/wch/arm/Libraries/ch32_drivers/drv_gpio_ch32f20x.c index 3d92078129..f5a72b0c65 100644 --- a/bsp/wch/arm/Libraries/ch32_drivers/drv_gpio_ch32f20x.c +++ b/bsp/wch/arm/Libraries/ch32_drivers/drv_gpio_ch32f20x.c @@ -398,12 +398,12 @@ rt_err_t ch32f2_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint8 find = exti_line_irq_list_find(pin); if (find == RT_NULL) - return RT_EINVAL; + return -RT_EINVAL; item = pin_info_list_find(pin); if (item == RT_NULL) - return RT_EINVAL; + return -RT_EINVAL; if (enabled == PIN_IRQ_ENABLE) { diff --git a/bsp/wch/arm/Libraries/ch32_drivers/drv_hwtimer_ch32f10x.c b/bsp/wch/arm/Libraries/ch32_drivers/drv_hwtimer_ch32f10x.c index 2a7671c278..ab73bf83a9 100644 --- a/bsp/wch/arm/Libraries/ch32_drivers/drv_hwtimer_ch32f10x.c +++ b/bsp/wch/arm/Libraries/ch32_drivers/drv_hwtimer_ch32f10x.c @@ -210,7 +210,7 @@ static rt_err_t ch32f1_hwtimer_control(struct rt_hwtimer_device *device, rt_uint } else { - result = RT_EINVAL; + result = -RT_EINVAL; } } break; diff --git a/bsp/wch/arm/Libraries/ch32_drivers/drv_hwtimer_ch32f20x.c b/bsp/wch/arm/Libraries/ch32_drivers/drv_hwtimer_ch32f20x.c index 564180a269..1631ee95d0 100644 --- a/bsp/wch/arm/Libraries/ch32_drivers/drv_hwtimer_ch32f20x.c +++ b/bsp/wch/arm/Libraries/ch32_drivers/drv_hwtimer_ch32f20x.c @@ -258,7 +258,7 @@ static rt_err_t ch32f2_hwtimer_control(struct rt_hwtimer_device *device, rt_uint } else { - result = RT_EINVAL; + result = -RT_EINVAL; } } break; diff --git a/bsp/wch/arm/Libraries/ch32_drivers/drv_pwm_ch32f10x.c b/bsp/wch/arm/Libraries/ch32_drivers/drv_pwm_ch32f10x.c index 646e593f49..dbd5eb21ad 100644 --- a/bsp/wch/arm/Libraries/ch32_drivers/drv_pwm_ch32f10x.c +++ b/bsp/wch/arm/Libraries/ch32_drivers/drv_pwm_ch32f10x.c @@ -180,13 +180,13 @@ static rt_err_t ch32f1_pwm_device_enable(struct rt_device_pwm *device, struct rt if (channel_index <= 4 && channel_index > 0) { if (pwm_device->channel[channel_index - 1] == 0xFF) - return RT_EINVAL; + return -RT_EINVAL; TIM_CCxCmd(pwm_device->periph, pwm_device->channel[channel_index - 1], ccx_state); } else { - return RT_EINVAL; + return -RT_EINVAL; } TIM_Cmd(pwm_device->periph, ENABLE); @@ -234,7 +234,7 @@ static rt_err_t ch32f1_pwm_device_get(struct rt_device_pwm *device, struct rt_pw configuration->pulse = ((ccr_counter * 100) / arr_counter) * configuration->period / 100; } else - return RT_EINVAL; + return -RT_EINVAL; return RT_EOK; } @@ -330,7 +330,7 @@ static rt_err_t ch32f1_pwm_device_set(struct rt_device_pwm *device, struct rt_pw } else { - return RT_EINVAL; + return -RT_EINVAL; } TIM_ARRPreloadConfig(pwm_device->periph, ENABLE); @@ -356,7 +356,7 @@ static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg case PWM_CMD_GET: return ch32f1_pwm_device_get(device, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/wch/arm/Libraries/ch32_drivers/drv_pwm_ch32f20x.c b/bsp/wch/arm/Libraries/ch32_drivers/drv_pwm_ch32f20x.c index 791d9f148d..6393391138 100644 --- a/bsp/wch/arm/Libraries/ch32_drivers/drv_pwm_ch32f20x.c +++ b/bsp/wch/arm/Libraries/ch32_drivers/drv_pwm_ch32f20x.c @@ -301,13 +301,13 @@ static rt_err_t ch32f2_pwm_device_enable(struct rt_device_pwm *device, struct rt if (channel_index <= 4 && channel_index > 0) { if (pwm_device->channel[channel_index - 1] == 0xFF) - return RT_EINVAL; + return -RT_EINVAL; TIM_CCxCmd(pwm_device->periph, pwm_device->channel[channel_index - 1], ccx_state); } else { - return RT_EINVAL; + return -RT_EINVAL; } TIM_Cmd(pwm_device->periph, ENABLE); @@ -355,7 +355,7 @@ static rt_err_t ch32f2_pwm_device_get(struct rt_device_pwm *device, struct rt_pw configuration->pulse = ((ccr_counter * 100) / arr_counter) * configuration->period / 100; } else - return RT_EINVAL; + return -RT_EINVAL; return RT_EOK; } @@ -451,7 +451,7 @@ static rt_err_t ch32f2_pwm_device_set(struct rt_device_pwm *device, struct rt_pw } else { - return RT_EINVAL; + return -RT_EINVAL; } TIM_ARRPreloadConfig(pwm_device->periph, ENABLE); @@ -477,7 +477,7 @@ static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg case PWM_CMD_GET: return ch32f2_pwm_device_get(device, configuration); default: - return RT_EINVAL; + return -RT_EINVAL; } } diff --git a/bsp/yichip/yc3121-pos/drivers/drv_gpio.c b/bsp/yichip/yc3121-pos/drivers/drv_gpio.c index fc695a0318..22c3b8fe29 100644 --- a/bsp/yichip/yc3121-pos/drivers/drv_gpio.c +++ b/bsp/yichip/yc3121-pos/drivers/drv_gpio.c @@ -209,7 +209,7 @@ static rt_err_t yc_pin_irq_enable(struct rt_device *device, break; default: rt_hw_interrupt_enable(level); - return RT_EINVAL; + return -RT_EINVAL; } level = rt_hw_interrupt_disable(); diff --git a/components/drivers/wlan/wlan_mgnt.c b/components/drivers/wlan/wlan_mgnt.c index 768d342069..27bd5623c8 100644 --- a/components/drivers/wlan/wlan_mgnt.c +++ b/components/drivers/wlan/wlan_mgnt.c @@ -1670,7 +1670,7 @@ rt_err_t rt_wlan_register_event_handler(rt_wlan_event_t event, rt_wlan_event_han if (event >= RT_WLAN_EVT_MAX) { - return RT_EINVAL; + return -RT_EINVAL; } RT_WLAN_LOG_D("%s is run event:%d", __FUNCTION__, event); @@ -1690,7 +1690,7 @@ rt_err_t rt_wlan_unregister_event_handler(rt_wlan_event_t event) if (event >= RT_WLAN_EVT_MAX) { - return RT_EINVAL; + return -RT_EINVAL; } RT_WLAN_LOG_D("%s is run event:%d", __FUNCTION__, event); MGNT_LOCK(); diff --git a/components/lwp/lwp_signal.c b/components/lwp/lwp_signal.c index ccebec7d80..44a1083c57 100644 --- a/components/lwp/lwp_signal.c +++ b/components/lwp/lwp_signal.c @@ -455,7 +455,7 @@ int lwp_sigprocmask(int how, const lwp_sigset_t *sigset, lwp_sigset_t *oset) newset = *sigset; break; default: - ret = RT_EINVAL; + ret = -RT_EINVAL; goto out; } diff --git a/components/utilities/rt-link/src/rtlink_dev.c b/components/utilities/rt-link/src/rtlink_dev.c index 24c45585ea..85d19abd4c 100644 --- a/components/utilities/rt-link/src/rtlink_dev.c +++ b/components/utilities/rt-link/src/rtlink_dev.c @@ -321,7 +321,7 @@ rt_err_t rt_link_dev_control(rt_device_t dev, int cmd, void *args) if (cmd & RT_DEVICE_CTRL_CONFIG) { if (args == RT_NULL) - return RT_EINVAL; + return -RT_EINVAL; RTLINK_SERV(dev).service = ((struct rt_link_service *)args)->service; RTLINK_SERV(dev).timeout_tx = ((struct rt_link_service *)args)->timeout_tx; RTLINK_SERV(dev).flag = ((struct rt_link_service *)args)->flag;