From 6e63cbb9be9f2c6fa8d1b05f47976527c306bfff Mon Sep 17 00:00:00 2001 From: bernard Date: Thu, 15 Jun 2017 14:36:40 +0800 Subject: [PATCH] [DFS] "console" device check. [DFS] To make sure the "console" device exist or not when initialize console device. --- components/dfs/filesystems/devfs/console.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/dfs/filesystems/devfs/console.c b/components/dfs/filesystems/devfs/console.c index e3302e4268..8c782fe6a2 100644 --- a/components/dfs/filesystems/devfs/console.c +++ b/components/dfs/filesystems/devfs/console.c @@ -78,6 +78,9 @@ void rt_console_init(const char* device_name) rt_device_t device; /* register to device framework */ + device = rt_device_find("console"); + if (device) return; /* not register a same name device */ + device = rt_device_find(device_name); if (device != RT_NULL) {