Skip to content

Commit 0cdf72f

Browse files
Solonix-Chumysterywolf
authored andcommitted
[bsp] Modify the RT_Exxx error return value to a negative number
1 parent 4aa38e3 commit 0cdf72f

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

bsp/mm32f327x/drivers/drv_adc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static rt_uint8_t mm32_adc_get_resolution(struct rt_adc_device *device)
127127
static rt_int16_t mm32_adc_get_vref(struct rt_adc_device *device)
128128
{
129129
if(device == RT_NULL)
130-
return RT_ERROR;
130+
return -RT_ERROR;
131131

132132
return 3300;
133133
}

bsp/raspberry-pi/raspi4-64/drivers/drv_eth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ static rt_err_t bcmgenet_eth_init(rt_device_t device)
574574
major = 1;
575575

576576
rt_kprintf("Uns upported GENETv%d.%d\n", major, (hw_reg >> 16) & 0x0f);
577-
return RT_ERROR;
577+
return -RT_ERROR;
578578
}
579579
/* set interface */
580580
ret = bcmgenet_interface_set();

bsp/raspberry-pi/raspi4-64/drivers/drv_sdio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ static rt_err_t sdhci_setclock(struct sdhci_t * sdhci, rt_uint32_t clock)
437437
if (count <= 0)
438438
{
439439
rt_kprintf("EMMC: Set clock: timeout waiting for inhibit flags. Status %08x.\n",read32(pdat->virt + EMMC_STATUS));
440-
return RT_ERROR;
440+
return -RT_ERROR;
441441
}
442442

443443
// Switch clock off.
@@ -471,7 +471,7 @@ static rt_err_t sdhci_setclock(struct sdhci_t * sdhci, rt_uint32_t clock)
471471
if (count <= 0)
472472
{
473473
rt_kprintf("EMMC: ERROR: failed to get stable clock %d.\n", clock);
474-
return RT_ERROR;
474+
return -RT_ERROR;
475475
}
476476

477477
mmcsd_dbg("set stable clock %d.\n", clock);

bsp/raspberry-pi/raspi4-64/drivers/drv_spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static rt_uint32_t raspi_spi_xfer(struct rt_spi_device *device, struct rt_spi_me
185185
(config.mode & RT_SPI_CS_HIGH)?prev_raspi_pin_write(cs_pin, 0):prev_raspi_pin_write(cs_pin, 1);
186186
}
187187
if (res != RT_EOK)
188-
return RT_ERROR;
188+
return -RT_ERROR;
189189

190190
return message->length;
191191
}

bsp/raspberry-pi/raspi4-64/drivers/drv_wdt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static rt_err_t raspi_wdg_control(rt_watchdog_t *wdt, int cmd, void *arg)
9595
raspi_watchdog_stop();
9696
break;
9797
default:
98-
return RT_EIO;
98+
return -RT_EIO;
9999
}
100100
return RT_EOK;
101101
}

0 commit comments

Comments
 (0)