diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-15 23:12:58 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-15 23:12:58 +0200 |
commit | 1e09481365ce248dbb4eb06dad70129bb5807037 (patch) | |
tree | c0cff5bef95c8b5e7486f144718ade9a06c284dc /drivers/pcmcia/i82365.c | |
parent | 3e2f69fdd1b00166e7d589bce56b2d36a9e74374 (diff) | |
parent | b9d2252c1e44fa83a4e65fdc9eb93db6297c55af (diff) |
Merge branch 'linus' into core/softlockup
Conflicts:
kernel/softlockup.c
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/pcmcia/i82365.c')
-rw-r--r-- | drivers/pcmcia/i82365.c | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c index 32a2ab11979..68f6b2702bc 100644 --- a/drivers/pcmcia/i82365.c +++ b/drivers/pcmcia/i82365.c @@ -1263,7 +1263,7 @@ static int __init init_i82365(void) ret = driver_register(&i82365_driver); if (ret) - return ret; + goto err_out; i82365_device = platform_device_alloc("i82365", 0); if (i82365_device) { @@ -1273,10 +1273,8 @@ static int __init init_i82365(void) } else ret = -ENOMEM; - if (ret) { - driver_unregister(&i82365_driver); - return ret; - } + if (ret) + goto err_driver_unregister; printk(KERN_INFO "Intel ISA PCIC probe: "); sockets = 0; @@ -1285,16 +1283,17 @@ static int __init init_i82365(void) if (sockets == 0) { printk("not found.\n"); - platform_device_unregister(i82365_device); - release_region(i365_base, 2); - driver_unregister(&i82365_driver); - return -ENODEV; + ret = -ENODEV; + goto err_dev_unregister; } /* Set up interrupt handler(s) */ if (grab_irq != 0) - request_irq(cs_irq, pcic_interrupt, 0, "i82365", pcic_interrupt); - + ret = request_irq(cs_irq, pcic_interrupt, 0, "i82365", pcic_interrupt); + + if (ret) + goto err_socket_release; + /* register sockets with the pcmcia core */ for (i = 0; i < sockets; i++) { socket[i].socket.dev.parent = &i82365_device->dev; @@ -1324,7 +1323,23 @@ static int __init init_i82365(void) } return 0; - +err_socket_release: + for (i = 0; i < sockets; i++) { + /* Turn off all interrupt sources! */ + i365_set(i, I365_CSCINT, 0); + release_region(socket[i].ioaddr, 2); + } +err_dev_unregister: + platform_device_unregister(i82365_device); + release_region(i365_base, 2); +#ifdef CONFIG_PNP + if (i82365_pnpdev) + pnp_disable_dev(i82365_pnpdev); +#endif +err_driver_unregister: + driver_unregister(&i82365_driver); +err_out: + return ret; } /* init_i82365 */ static void __exit exit_i82365(void) |