mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <dev@lynxeye.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/3] common: console_console: put functions under correct ifdef
Date: Sun, 18 Jan 2015 21:57:02 +0100	[thread overview]
Message-ID: <1421614624-14656-1-git-send-email-dev@lynxeye.de> (raw)

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>
---
 common/console_common.c | 70 ++++++++++++++++++++++++-------------------------
 1 file changed, 35 insertions(+), 35 deletions(-)

diff --git a/common/console_common.c b/common/console_common.c
index df1b085982ad..d88e678aadb5 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);
-- 
2.1.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2015-01-18 20:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-18 20:57 Lucas Stach [this message]
2015-01-18 20:57 ` [PATCH 2/3] usb: musb-dsps: select OFDEVICE Lucas Stach
2015-01-18 20:57 ` [PATCH 3/3] arm: board: virt2real: build lowlevel in proper target Lucas Stach
2015-01-19  7:47 ` [PATCH 1/3] common: console_console: put functions under correct ifdef Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421614624-14656-1-git-send-email-dev@lynxeye.de \
    --to=dev@lynxeye.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox