diff options
| author | bernard <[email protected]> | 2017-06-15 14:36:40 +0800 |
|---|---|---|
| committer | bernard <[email protected]> | 2017-06-15 14:36:40 +0800 |
| commit | 6e63cbb9be9f2c6fa8d1b05f47976527c306bfff (patch) | |
| tree | 1995d2f2648c7d409a30a6b32a4a62c6fe449137 | |
| parent | a453b3318bb7ee8b62f95145c12b5a85c35d589d (diff) | |
[DFS] "console" device check.
[DFS] To make sure the "console" device exist or not when initialize
console device.
| -rw-r--r-- | components/dfs/filesystems/devfs/console.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) { |
