Subject: Re: [PATCH 2 of 2] netconsole: add write-only tty driver

From: Evgeniy Polyakov <[email-masked]>
Date: Fri, 28 Nov 2008 00:47:01 +0300

Hi.

Looks good. A short note below.

On Thu, Nov 27, 2008 at 03:11:02PM -0600, Hollis Blanchard ([email-masked]) wrote:
> +static int __init netconsole_tty_init(void)
> +{
> +	netconsole_tty_driver = alloc_tty_driver(1);
> +	if (!netconsole_tty_driver)
> +		return -ENOMEM;
> +
> +	netconsole_tty_driver->owner = THIS_MODULE;
> +	netconsole_tty_driver->driver_name = "netcon";
> +	netconsole_tty_driver->name = "netcon";
> +	netconsole_tty_driver->minor_start = 0;
> +	netconsole_tty_driver->type = TTY_DRIVER_TYPE_SYSTEM;
> +	netconsole_tty_driver->init_termios = tty_std_termios;
> +	netconsole_tty_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL;
> +	netconsole_tty_driver->init_termios.c_ispeed = 9600;
> +	netconsole_tty_driver->init_termios.c_ospeed = 9600;
> +	netconsole_tty_driver->flags = TTY_DRIVER_REAL_RAW;
> +	tty_set_operations(netconsole_tty_driver, &netconsole_tty_ops);
> +
> +	if (tty_register_driver(netconsole_tty_driver))
> +		printk(KERN_ERR "Couldn't register netconsole tty driver\n");
> +
> +	return 0;
> +}
> +device_initcall(netconsole_tty_init);

Would it be better called from init_netconsole()?

-- 
	Evgeniy Polyakov