Commit cc93441e authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

TTY: synclink_cs, final cleanup in synclink_cs_init

* use <tab> for indentation
* add KERN_* to printks
* no more assignments in if's like if ((rc = function()))
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Acked-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 16a1065f
...@@ -2803,47 +2803,46 @@ static const struct tty_operations mgslpc_ops = { ...@@ -2803,47 +2803,46 @@ static const struct tty_operations mgslpc_ops = {
static int __init synclink_cs_init(void) static int __init synclink_cs_init(void)
{ {
int rc; int rc;
if (break_on_load) { if (break_on_load) {
mgslpc_get_text_ptr(); mgslpc_get_text_ptr();
BREAKPOINT(); BREAKPOINT();
} }
serial_driver = tty_alloc_driver(MAX_DEVICE_COUNT, serial_driver = tty_alloc_driver(MAX_DEVICE_COUNT,
TTY_DRIVER_REAL_RAW | TTY_DRIVER_REAL_RAW |
TTY_DRIVER_DYNAMIC_DEV); TTY_DRIVER_DYNAMIC_DEV);
if (!serial_driver) { if (!serial_driver) {
rc = -ENOMEM; rc = -ENOMEM;
goto err; goto err;
} }
/* Initialize the tty_driver structure */ /* Initialize the tty_driver structure */
serial_driver->driver_name = "synclink_cs";
serial_driver->driver_name = "synclink_cs"; serial_driver->name = "ttySLP";
serial_driver->name = "ttySLP"; serial_driver->major = ttymajor;
serial_driver->major = ttymajor; serial_driver->minor_start = 64;
serial_driver->minor_start = 64; serial_driver->type = TTY_DRIVER_TYPE_SERIAL;
serial_driver->type = TTY_DRIVER_TYPE_SERIAL; serial_driver->subtype = SERIAL_TYPE_NORMAL;
serial_driver->subtype = SERIAL_TYPE_NORMAL; serial_driver->init_termios = tty_std_termios;
serial_driver->init_termios = tty_std_termios; serial_driver->init_termios.c_cflag =
serial_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
B9600 | CS8 | CREAD | HUPCL | CLOCAL; tty_set_operations(serial_driver, &mgslpc_ops);
tty_set_operations(serial_driver, &mgslpc_ops);
rc = tty_register_driver(serial_driver);
if ((rc = tty_register_driver(serial_driver)) < 0) { if (rc < 0) {
printk("%s(%d):Couldn't register serial driver\n", printk(KERN_ERR "%s(%d):Couldn't register serial driver\n",
__FILE__,__LINE__); __FILE__, __LINE__);
goto err_put_tty; goto err_put_tty;
} }
rc = pcmcia_register_driver(&mgslpc_driver); rc = pcmcia_register_driver(&mgslpc_driver);
if (rc < 0) if (rc < 0)
goto err_unreg_tty; goto err_unreg_tty;
printk("%s %s, tty major#%d\n", printk(KERN_INFO "%s %s, tty major#%d\n", driver_name, driver_version,
driver_name, driver_version, serial_driver->major);
serial_driver->major);
return 0; return 0;
err_unreg_tty: err_unreg_tty:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment