summaryrefslogtreecommitdiff
path: root/components/drivers/core
diff options
context:
space:
mode:
authorShicheng Chu <[email protected]>2023-06-29 23:24:25 +0800
committerGitHub <[email protected]>2023-06-29 11:24:25 -0400
commite2c031643c8dec7c9ea1581216e19bf19c8f73f0 (patch)
tree926536732e7472c5e86ac5198b239d82f9f55da4 /components/drivers/core
parent148ae53cf8d3abc2c2e11c94c171b123b950b2fc (diff)
[include][dbg]update: no longer use RT_DEBUG_LOG in rtdebug.h (#7750)
Diffstat (limited to 'components/drivers/core')
-rw-r--r--components/drivers/core/device.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/components/drivers/core/device.c b/components/drivers/core/device.c
index 47482b50d3..c588789fec 100644
--- a/components/drivers/core/device.c
+++ b/components/drivers/core/device.c
@@ -16,6 +16,15 @@
*/
#include <rtthread.h>
+
+#define DBG_TAG "kernel.device"
+#ifdef RT_DEBUG_DEVICE
+#define DBG_LVL DBG_LOG
+#else
+#define DBG_LVL DBG_WARNING
+#endif /* defined (RT_DEBUG_DEVICE) */
+#include <rtdbg.h>
+
#ifdef RT_USING_POSIX_DEVIO
#include <rtdevice.h> /* for wqueue_init */
#endif /* RT_USING_POSIX_DEVIO */
@@ -178,8 +187,8 @@ rt_err_t rt_device_init(rt_device_t dev)
result = device_init(dev);
if (result != RT_EOK)
{
- RT_DEBUG_LOG(RT_DEBUG_DEVICE, ("To initialize device:%s failed. The error code is %d\n",
- dev->parent.name, result));
+ LOG_E("To initialize device:%s failed. The error code is %d",
+ dev->parent.name, result);
}
else
{
@@ -216,8 +225,8 @@ rt_err_t rt_device_open(rt_device_t dev, rt_uint16_t oflag)
result = device_init(dev);
if (result != RT_EOK)
{
- RT_DEBUG_LOG(RT_DEBUG_DEVICE, ("To initialize device:%s failed. The error code is %d\n",
- dev->parent.name, result));
+ LOG_E("To initialize device:%s failed. The error code is %d",
+ dev->parent.name, result);
return result;
}