Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71199
b: refs/heads/master
c: 4384a3f
h: refs/heads/master
i:
  71197: b7636b6
  71195: 445f94b
  71191: b626b08
  71183: 942a772
  71167: f069433
v: v3
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Oct 18, 2007
1 parent 7ed2edb commit 6ffe387
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 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: 57fedc7ae5f712c9c24f5baf30a0fbf38c1bda20
refs/heads/master: 4384a3fae10c1badb859d2c98a6d2944b14609f6
34 changes: 20 additions & 14 deletions trunk/drivers/char/rocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -2359,14 +2359,14 @@ static const struct tty_operations rocket_ops = {
*/
static int __init rp_init(void)
{
int retval, pci_boards_found, isa_boards_found, i;
int ret = -ENOMEM, pci_boards_found, isa_boards_found, i;

printk(KERN_INFO "RocketPort device driver module, version %s, %s\n",
ROCKET_VERSION, ROCKET_DATE);

rocket_driver = alloc_tty_driver(MAX_RP_PORTS);
if (!rocket_driver)
return -ENOMEM;
goto err;

/*
* If board 1 is non-zero, there is at least one ISA configured. If controller is
Expand All @@ -2381,8 +2381,11 @@ static int __init rp_init(void)

/* If an ISA card is configured, reserve the 4 byte IO space for the Mudbac controller */
if (controller && (!request_region(controller, 4, "Comtrol RocketPort"))) {
printk(KERN_INFO "Unable to reserve IO region for first configured ISA RocketPort controller 0x%lx. Driver exiting \n", controller);
return -EBUSY;
printk(KERN_ERR "Unable to reserve IO region for first "
"configured ISA RocketPort controller 0x%lx. "
"Driver exiting\n", controller);
ret = -EBUSY;
goto err_tty;
}

/* Store ISA variable retrieved from command line or .conf file. */
Expand Down Expand Up @@ -2423,11 +2426,10 @@ static int __init rp_init(void)
#endif
tty_set_operations(rocket_driver, &rocket_ops);

retval = tty_register_driver(rocket_driver);
if (retval < 0) {
printk(KERN_INFO "Couldn't install tty RocketPort driver (error %d)\n", -retval);
put_tty_driver(rocket_driver);
return -1;
ret = tty_register_driver(rocket_driver);
if (ret < 0) {
printk(KERN_ERR "Couldn't install tty RocketPort driver\n");
goto err_tty;
}

#ifdef ROCKET_DEBUG_OPEN
Expand All @@ -2454,14 +2456,18 @@ static int __init rp_init(void)
max_board = pci_boards_found + isa_boards_found;

if (max_board == 0) {
printk(KERN_INFO "No rocketport ports found; unloading driver.\n");
del_timer_sync(&rocket_timer);
tty_unregister_driver(rocket_driver);
put_tty_driver(rocket_driver);
return -ENXIO;
printk(KERN_ERR "No rocketport ports found; unloading driver\n");
ret = -ENXIO;
goto err_ttyu;
}

return 0;
err_ttyu:
tty_unregister_driver(rocket_driver);
err_tty:
put_tty_driver(rocket_driver);
err:
return ret;
}


Expand Down

0 comments on commit 6ffe387

Please sign in to comment.