mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-22 22:29:12 +08:00
commit
55c3182b78
@ -430,10 +430,12 @@ int rt_hw_sensor_register(rt_sensor_t sensor,
|
|||||||
result = rt_device_register(device, device_name, flag | RT_DEVICE_FLAG_STANDALONE);
|
result = rt_device_register(device, device_name, flag | RT_DEVICE_FLAG_STANDALONE);
|
||||||
if (result != RT_EOK)
|
if (result != RT_EOK)
|
||||||
{
|
{
|
||||||
|
rt_free(device_name);
|
||||||
LOG_E("rt_sensor register err code: %d", result);
|
LOG_E("rt_sensor register err code: %d", result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rt_free(device_name);
|
||||||
LOG_I("rt_sensor init success");
|
LOG_I("rt_sensor init success");
|
||||||
return RT_EOK;
|
return RT_EOK;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user