Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54842
b: refs/heads/master
c: 9dacf3b
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed May 8, 2007
1 parent 136e218 commit 7dccde7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 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: 14a55a6789d8409e58329310f9a18fc141deb4c2
refs/heads/master: 9dacf3b2f0cc657a5621e7f6d67ed27ce598f405
23 changes: 19 additions & 4 deletions trunk/drivers/char/cyclades.c
Original file line number Diff line number Diff line change
Expand Up @@ -5460,10 +5460,11 @@ static const struct tty_operations cy_ops = {
static int __init cy_init(void)
{
unsigned int i, nboards;
int retval = -ENOMEM;

cy_serial_driver = alloc_tty_driver(NR_PORTS);
if (!cy_serial_driver)
return -ENOMEM;
goto err;
show_version();

/* Initialize the tty_driver structure */
Expand All @@ -5481,8 +5482,11 @@ static int __init cy_init(void)
cy_serial_driver->flags = TTY_DRIVER_REAL_RAW;
tty_set_operations(cy_serial_driver, &cy_ops);

if (tty_register_driver(cy_serial_driver))
panic("Couldn't register Cyclades serial driver\n");
retval = tty_register_driver(cy_serial_driver);
if (retval) {
printk(KERN_ERR "Couldn't register Cyclades serial driver\n");
goto err_frtty;
}

for (i = 0; i < NR_CARDS; i++) {
/* base_addr=0 indicates board not found */
Expand All @@ -5508,7 +5512,18 @@ static int __init cy_init(void)
/* look for pci boards */
nboards += cy_detect_pci();

return nboards ? 0 : -ENODEV;
if (nboards == 0) {
retval = -ENODEV;
goto err_unr;
}

return 0;
err_unr:
tty_unregister_driver(cy_serial_driver);
err_frtty:
put_tty_driver(cy_serial_driver);
err:
return retval;
} /* cy_init */

static void __exit cy_cleanup_module(void)
Expand Down

0 comments on commit 7dccde7

Please sign in to comment.