提交 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)
static rt_int16_t mm32_adc_get_vref(struct rt_adc_device *device)
{
if(device == RT_NULL)
return RT_ERROR;
return -RT_ERROR;
return 3300;
}
......
......@@ -574,7 +574,7 @@ static rt_err_t bcmgenet_eth_init(rt_device_t device)
major = 1;
rt_kprintf("Uns upported GENETv%d.%d\n", major, (hw_reg >> 16) & 0x0f);
return RT_ERROR;
return -RT_ERROR;
}
/* set interface */
ret = bcmgenet_interface_set();
......
......@@ -437,7 +437,7 @@ static rt_err_t sdhci_setclock(struct sdhci_t * sdhci, rt_uint32_t clock)
if (count <= 0)
{
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.
......@@ -471,7 +471,7 @@ static rt_err_t sdhci_setclock(struct sdhci_t * sdhci, rt_uint32_t clock)
if (count <= 0)
{
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);
......
......@@ -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);
}
if (res != RT_EOK)
return RT_ERROR;
return -RT_ERROR;
return message->length;
}
......
......@@ -95,7 +95,7 @@ static rt_err_t raspi_wdg_control(rt_watchdog_t *wdt, int cmd, void *arg)
raspi_watchdog_stop();
break;
default:
return RT_EIO;
return -RT_EIO;
}
return RT_EOK;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册