Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325659
b: refs/heads/master
c: 737586f
h: refs/heads/master
i:
  325657: 95e3e44
  325655: 867302e
v: v3
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Aug 13, 2012
1 parent 83a0537 commit a87f295
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b19e2ca77ee4becadc85341bb0c1cee454dd4fd5
refs/heads/master: 737586fe51e6d0031f83d781c0cb2f3abf8caada
41 changes: 14 additions & 27 deletions trunk/drivers/char/pcmcia/synclink_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2798,23 +2798,6 @@ static const struct tty_operations mgslpc_ops = {
.proc_fops = &mgslpc_proc_fops,
};

static void synclink_cs_cleanup(void)
{
int rc;

while(mgslpc_device_list)
mgslpc_remove_device(mgslpc_device_list);

if (serial_driver) {
if ((rc = tty_unregister_driver(serial_driver)))
printk("%s(%d) failed to unregister tty driver err=%d\n",
__FILE__,__LINE__,rc);
put_tty_driver(serial_driver);
}

pcmcia_unregister_driver(&mgslpc_driver);
}

static int __init synclink_cs_init(void)
{
int rc;
Expand All @@ -2830,7 +2813,7 @@ static int __init synclink_cs_init(void)
serial_driver = alloc_tty_driver(MAX_DEVICE_COUNT);
if (!serial_driver) {
rc = -ENOMEM;
goto error;
goto err_pcmcia_drv;
}

/* Initialize the tty_driver structure */
Expand All @@ -2850,25 +2833,29 @@ static int __init synclink_cs_init(void)
if ((rc = tty_register_driver(serial_driver)) < 0) {
printk("%s(%d):Couldn't register serial driver\n",
__FILE__,__LINE__);
put_tty_driver(serial_driver);
serial_driver = NULL;
goto error;
goto err_put_tty;
}

printk("%s %s, tty major#%d\n",
driver_name, driver_version,
serial_driver->major);

return 0;

error:
synclink_cs_cleanup();
return rc;
return 0;
err_put_tty:
put_tty_driver(serial_driver);
err_pcmcia_drv:
pcmcia_unregister_driver(&mgslpc_driver);
return rc;
}

static void __exit synclink_cs_exit(void)
{
synclink_cs_cleanup();
while (mgslpc_device_list)
mgslpc_remove_device(mgslpc_device_list);

tty_unregister_driver(serial_driver);
put_tty_driver(serial_driver);
pcmcia_unregister_driver(&mgslpc_driver);
}

module_init(synclink_cs_init);
Expand Down

0 comments on commit a87f295

Please sign in to comment.