From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 2/5] console: introduce console_get_by_dev
Date: Thu, 19 Sep 2013 15:20:23 +0200 [thread overview]
Message-ID: <1379596826-5743-2-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1379596826-5743-1-git-send-email-plagnioj@jcrosoft.com>
so we can get console by it's device
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
common/console_common.c | 13 +++++++++++++
include/console.h | 2 ++
2 files changed, 15 insertions(+)
diff --git a/common/console_common.c b/common/console_common.c
index d139d1a..24aa63e 100644
--- a/common/console_common.c
+++ b/common/console_common.c
@@ -108,3 +108,16 @@ 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);
diff --git a/include/console.h b/include/console.h
index 72cf99f..355e259 100644
--- a/include/console.h
+++ b/include/console.h
@@ -49,6 +49,8 @@ struct console_device {
int console_register(struct console_device *cdev);
int console_unregister(struct console_device *cdev);
+struct console_device *console_get_by_dev(struct device_d *dev);
+
extern struct list_head console_list;
#define for_each_console(console) list_for_each_entry(console, &console_list, list)
--
1.8.4.rc1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-09-19 13:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-19 13:19 [PATCH 0/5] introduce basic rs485 support Jean-Christophe PLAGNIOL-VILLARD
2013-09-19 13:20 ` [PATCH 1/5] shutdown: add board call back Jean-Christophe PLAGNIOL-VILLARD
2013-09-19 13:20 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2013-09-19 13:20 ` [PATCH 3/5] console: introduce new callback set_mode Jean-Christophe PLAGNIOL-VILLARD
2013-09-19 13:20 ` [PATCH 4/5] atmel_serial: add rs485 support Jean-Christophe PLAGNIOL-VILLARD
2013-09-19 13:20 ` [PATCH 5/5] Animeo IP: add rs485 crossing detection support Jean-Christophe PLAGNIOL-VILLARD
2013-09-24 7:22 ` [PATCH 0/5] introduce basic rs485 support 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=1379596826-5743-2-git-send-email-plagnioj@jcrosoft.com \
--to=plagnioj@jcrosoft.com \
--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