提交 0cdf72f7 编写于 作者: 褚仕成 提交者: mysterywolf

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

上级 4aa38e3d
...@@ -127,7 +127,7 @@ static rt_uint8_t mm32_adc_get_resolution(struct rt_adc_device *device) ...@@ -127,7 +127,7 @@ static rt_uint8_t mm32_adc_get_resolution(struct rt_adc_device *device)
static rt_int16_t mm32_adc_get_vref(struct rt_adc_device *device) static rt_int16_t mm32_adc_get_vref(struct rt_adc_device *device)
{ {
if(device == RT_NULL) if(device == RT_NULL)
return RT_ERROR; return -RT_ERROR;
return 3300; return 3300;
} }
......
...@@ -574,7 +574,7 @@ static rt_err_t bcmgenet_eth_init(rt_device_t device) ...@@ -574,7 +574,7 @@ static rt_err_t bcmgenet_eth_init(rt_device_t device)
major = 1; major = 1;
rt_kprintf("Uns upported GENETv%d.%d\n", major, (hw_reg >> 16) & 0x0f); rt_kprintf("Uns upported GENETv%d.%d\n", major, (hw_reg >> 16) & 0x0f);
return RT_ERROR; return -RT_ERROR;
} }
/* set interface */ /* set interface */
ret = bcmgenet_interface_set(); ret = bcmgenet_interface_set();
......
...@@ -437,7 +437,7 @@ static rt_err_t sdhci_setclock(struct sdhci_t * sdhci, rt_uint32_t clock) ...@@ -437,7 +437,7 @@ static rt_err_t sdhci_setclock(struct sdhci_t * sdhci, rt_uint32_t clock)
if (count <= 0) if (count <= 0)
{ {
rt_kprintf("EMMC: Set clock: timeout waiting for inhibit flags. Status %08x.\n",read32(pdat->virt + EMMC_STATUS)); rt_kprintf("EMMC: Set clock: timeout waiting for inhibit flags. Status %08x.\n",read32(pdat->virt + EMMC_STATUS));
return RT_ERROR; return -RT_ERROR;
} }
// Switch clock off. // Switch clock off.
...@@ -471,7 +471,7 @@ static rt_err_t sdhci_setclock(struct sdhci_t * sdhci, rt_uint32_t clock) ...@@ -471,7 +471,7 @@ static rt_err_t sdhci_setclock(struct sdhci_t * sdhci, rt_uint32_t clock)
if (count <= 0) if (count <= 0)
{ {
rt_kprintf("EMMC: ERROR: failed to get stable clock %d.\n", clock); rt_kprintf("EMMC: ERROR: failed to get stable clock %d.\n", clock);
return RT_ERROR; return -RT_ERROR;
} }
mmcsd_dbg("set stable clock %d.\n", clock); mmcsd_dbg("set stable clock %d.\n", clock);
......
...@@ -185,7 +185,7 @@ static rt_uint32_t raspi_spi_xfer(struct rt_spi_device *device, struct rt_spi_me ...@@ -185,7 +185,7 @@ static rt_uint32_t raspi_spi_xfer(struct rt_spi_device *device, struct rt_spi_me
(config.mode & RT_SPI_CS_HIGH)?prev_raspi_pin_write(cs_pin, 0):prev_raspi_pin_write(cs_pin, 1); (config.mode & RT_SPI_CS_HIGH)?prev_raspi_pin_write(cs_pin, 0):prev_raspi_pin_write(cs_pin, 1);
} }
if (res != RT_EOK) if (res != RT_EOK)
return RT_ERROR; return -RT_ERROR;
return message->length; return message->length;
} }
......
...@@ -95,7 +95,7 @@ static rt_err_t raspi_wdg_control(rt_watchdog_t *wdt, int cmd, void *arg) ...@@ -95,7 +95,7 @@ static rt_err_t raspi_wdg_control(rt_watchdog_t *wdt, int cmd, void *arg)
raspi_watchdog_stop(); raspi_watchdog_stop();
break; break;
default: default:
return RT_EIO; return -RT_EIO;
} }
return RT_EOK; return RT_EOK;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册