From fc7abc658013d326d47145f85402cead0728b1a0 Mon Sep 17 00:00:00 2001 From: ArdaFu Date: Mon, 16 Oct 2017 15:12:35 +0800 Subject: [PATCH] [components][drivers] Check macro "RT_USING_DFS" when using DFS relative method/functions. --- components/drivers/serial/serial.c | 3 ++- components/drivers/src/pipe.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index 48b60caeaf..c279490dec 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -48,6 +48,7 @@ #include #endif +#ifdef RT_USING_DFS #ifdef RT_USING_DFS_DEVFS #include @@ -209,7 +210,7 @@ const static struct dfs_file_ops _serial_fops = serial_fops_poll, }; #endif - +#endif /* * Serial poll routines */ diff --git a/components/drivers/src/pipe.c b/components/drivers/src/pipe.c index b455870c8a..bc9ed5f9a2 100644 --- a/components/drivers/src/pipe.c +++ b/components/drivers/src/pipe.c @@ -23,8 +23,10 @@ */ #include #include +#if defined(RT_USING_DFS) #include #include +#endif #if defined(RT_USING_DFS) && defined(RT_USING_DFS_DEVFS) static int pipe_open(struct dfs_fd *fd)