[PATCH 2/8] console: factorise function to get the first enabled console
Sascha Hauer
s.hauer at pengutronix.de
Fri Sep 27 04:44:47 EDT 2013
On Fri, Sep 27, 2013 at 09:14:12AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> +/**
> + * @brief returns current used console device
> + *
> + * @return console device which is registered with CONSOLE_STDIN and
> + * CONSOLE_STDOUT
> + */
> +struct console_device *console_get_first_current(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_current);
I find the function name misleading. Can we stick to the original name
or console_get_first_active?
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list