summaryrefslogtreecommitdiffstats
path: root/common/console_common.c
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2015-01-18 21:57:02 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-01-19 08:47:13 +0100
commit0914ad88d270af63f0107b2755aa8360b6d81dd5 (patch)
tree2528b90010d74e6f647747b676b5575dee8a7122 /common/console_common.c
parent68f772e10c88588efe7145025d27f360964ff549 (diff)
downloadbarebox-0914ad88d270af63f0107b2755aa8360b6d81dd5.tar.gz
common: console_console: put functions under correct ifdef
So they aren't build when no console support is selected. Fixes: In function `console_get_by_dev': undefined reference to `console_list' Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/console_common.c')
-rw-r--r--common/console_common.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/common/console_common.c b/common/console_common.c
index df1b085..d88e678 100644
--- a/common/console_common.c
+++ b/common/console_common.c
@@ -247,6 +247,41 @@ int vprintf(const char *fmt, va_list args)
}
EXPORT_SYMBOL(vprintf);
+struct console_device *console_get_by_dev(struct device_d *dev)
+{
+ struct console_device *cdev;
+
+ for_each_console(cdev) {
+ if (cdev->dev == dev)
+ return cdev;
+ }
+
+ return NULL;
+}
+EXPORT_SYMBOL(console_get_by_dev);
+
+/*
+ * @brief returns current used console device
+ *
+ * @return console device which is registered with CONSOLE_STDIN and
+ * CONSOLE_STDOUT
+ */
+struct console_device *console_get_first_active(void)
+{
+ struct console_device *cdev;
+ /*
+ * Assumption to have BOTH CONSOLE_STDIN AND STDOUT in the
+ * same output console
+ */
+ for_each_console(cdev) {
+ if ((cdev->f_active & (CONSOLE_STDIN | CONSOLE_STDOUT)))
+ return cdev;
+ }
+
+ return NULL;
+}
+EXPORT_SYMBOL(console_get_first_active);
+
#endif /* !CONFIG_CONSOLE_NONE */
int fprintf(int file, const char *fmt, ...)
@@ -291,38 +326,3 @@ int fputc(int fd, char c)
return 0;
}
EXPORT_SYMBOL(fputc);
-
-struct console_device *console_get_by_dev(struct device_d *dev)
-{
- struct console_device *cdev;
-
- for_each_console(cdev) {
- if (cdev->dev == dev)
- return cdev;
- }
-
- return NULL;
-}
-EXPORT_SYMBOL(console_get_by_dev);
-
-/*
- * @brief returns current used console device
- *
- * @return console device which is registered with CONSOLE_STDIN and
- * CONSOLE_STDOUT
- */
-struct console_device *console_get_first_active(void)
-{
- struct console_device *cdev;
- /*
- * Assumption to have BOTH CONSOLE_STDIN AND STDOUT in the
- * same output console
- */
- for_each_console(cdev) {
- if ((cdev->f_active & (CONSOLE_STDIN | CONSOLE_STDOUT)))
- return cdev;
- }
-
- return NULL;
-}
-EXPORT_SYMBOL(console_get_first_active);