提交 156fda61 编写于 作者: 嵌入式路上的流浪's avatar 嵌入式路上的流浪 提交者: mysterywolf

[errno code]fix that use RT_ENOMEM without -

上级 4ed9bc11
......@@ -444,14 +444,14 @@ rt_err_t at32_qspi_bus_attach_device(const char *bus_name, const char *device_na
if (qspi_device == RT_NULL)
{
LOG_E("no memory, qspi bus attach device failed!");
result = RT_ENOMEM;
result = -RT_ENOMEM;
goto __exit;
}
cs_pin = (struct at32_hw_spi_cs *)rt_malloc(sizeof(struct at32_hw_spi_cs));
if (qspi_device == RT_NULL)
{
LOG_E("no memory, qspi bus attach device failed!");
result = RT_ENOMEM;
result = -RT_ENOMEM;
goto __exit;
}
......
......@@ -288,7 +288,7 @@ rt_err_t ft2004_qspi_bus_attach_device(const char *bus_name, const char *device_
if (qspi_device == RT_NULL)
{
LOG_E("no memory, qspi bus attach device failed!");
result = RT_ENOMEM;
result = -RT_ENOMEM;
goto __exit;
}
......
......@@ -555,7 +555,7 @@ static rt_err_t rthw_sdctrl_create(ft_sdctrl_class_t *class_p)
if (host == RT_NULL)
{
LOG_E("L:%d F:%s mmcsd alloc host fail");
return RT_ENOMEM;
return -RT_ENOMEM;
}
class_p->ft_sdctrl.config = *(FSdCtrl_Config_t *)FSdCtrl_LookupConfig(0);
......
......@@ -561,7 +561,7 @@ rt_err_t rtgui_touch_hw_init(const char * spi_device_name)
}
touch = (struct rtgui_touch_device*)rt_malloc (sizeof(struct rtgui_touch_device));
if (touch == RT_NULL) return RT_ENOMEM; /* no memory yet */
if (touch == RT_NULL) return -RT_ENOMEM; /* no memory yet */
/* clear device structure */
rt_memset(&(touch->parent), 0, sizeof(struct rt_device));
......
......@@ -662,7 +662,7 @@ rt_err_t rt_hw_sdcard_init()
if (ptr_sddev == RT_NULL)
{
EOUT("Failed to allocate sdcard device structure\n");
return RT_ENOMEM;
return -RT_ENOMEM;
}
/*sdcard intialize*/
......@@ -689,7 +689,7 @@ rt_err_t rt_hw_sdcard_init()
if (ptr_sddev->part == RT_NULL)
{
EOUT("allocate partition failed\n");
err = RT_ENOMEM;
err = -RT_ENOMEM;
goto FAIL2;
}
......@@ -698,7 +698,7 @@ rt_err_t rt_hw_sdcard_init()
if (ptr_sddev->device == RT_NULL)
{
EOUT("allocate device failed\n");
err = RT_ENOMEM;
err = -RT_ENOMEM;
goto FAIL1;
}
......
......@@ -225,7 +225,7 @@ static rt_err_t nrf5x_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
}
if(irqindex == -1)
{
return RT_ENOMEM;
return -RT_ENOMEM;
}
level = rt_hw_interrupt_disable();
......@@ -264,7 +264,7 @@ static rt_err_t nrf5x_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
case NRFX_SUCCESS:
return RT_EOK;
case NRFX_ERROR_NO_MEM:
return RT_ENOMEM;
return -RT_ENOMEM;
default:
return -RT_ERROR;
}
......
......@@ -319,7 +319,7 @@ rt_err_t rt_hw_qspi_device_attach(const char *bus_name, const char *device_name,
if (qspi_device == RT_NULL)
{
LOG_E("no memory, qspi bus attach device failed!");
result = RT_ENOMEM;
result = -RT_ENOMEM;
goto __exit;
}
......
......@@ -36,7 +36,7 @@ struct rt_data_item
* @param evt_notify is the notification callback function.
*
* @return Return the operation status. When the return value is RT_EOK, the initialization is successful.
* When the return value is RT_ENOMEM, it means insufficient memory allocation failed.
* When the return value is -RT_ENOMEM, it means insufficient memory allocation failed.
*/
rt_err_t
rt_data_queue_init(struct rt_data_queue *queue,
......
......@@ -164,7 +164,7 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device)
device->cfg_desc = (ucfg_desc_t)rt_malloc(cfg_desc.wTotalLength);
if(device->cfg_desc == RT_NULL)
{
return RT_ENOMEM;
return -RT_ENOMEM;
}
rt_memset(device->cfg_desc, 0, cfg_desc.wTotalLength);
......@@ -225,7 +225,7 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device)
device->intf[i] = (struct uhintf*)rt_malloc(sizeof(struct uhintf));
if(device->intf[i] == RT_NULL)
{
return RT_ENOMEM;
return -RT_ENOMEM;
}
device->intf[i]->drv = drv;
device->intf[i]->device = device;
......
......@@ -199,7 +199,7 @@ static rt_err_t rym_download_file(rt_device_t idev,const char *file_path)
if (!ctx)
{
rt_kprintf("rt_malloc failed\n");
return RT_ENOMEM;
return -RT_ENOMEM;
}
ctx->fd = -1;
rt_strncpy(ctx->fpath, file_path, DFS_PATH_MAX);
......@@ -219,7 +219,7 @@ static rt_err_t rym_upload_file(rt_device_t idev, const char *file_path)
if (!ctx)
{
rt_kprintf("rt_malloc failed\n");
return RT_ENOMEM;
return -RT_ENOMEM;
}
ctx->fd = -1;
rt_strncpy(ctx->fpath, file_path, DFS_PATH_MAX);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册