From 050f0d5978efde602c890d565dcba1566be6a335 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Thu, 19 Sep 2013 15:20:23 +0200 Subject: console: introduce console_get_by_dev so we can get console by it's device Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Sascha Hauer --- common/console_common.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'common/console_common.c') 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); -- cgit v1.2.3