summaryrefslogtreecommitdiffstats
path: root/common/console_common.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2013-09-19 15:20:23 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-09-24 09:21:40 +0200
commit050f0d5978efde602c890d565dcba1566be6a335 (patch)
tree0abeddd2399b0dd0dbec32f9169222fa01f26067 /common/console_common.c
parent14e8e0a421004ae6fc3d9351fb44eb402e5da77a (diff)
downloadbarebox-050f0d5978efde602c890d565dcba1566be6a335.tar.gz
barebox-050f0d5978efde602c890d565dcba1566be6a335.tar.xz
console: introduce console_get_by_dev
so we can get console by it's device Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/console_common.c')
-rw-r--r--common/console_common.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/common/console_common.c b/common/console_common.c
index d139d1a8fe..24aa63eea1 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);