aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/i82365.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 16:24:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-14 16:24:39 -0400
commit42c59208219a2d43f0dde94bebc68c20b95b13ce (patch)
treeff20941f83a92ffb4224c95ddee9b7eb225ed958 /drivers/pcmcia/i82365.c
parentdddec01eb8e2b56267b37a6f9f0997a64b4e0b2a (diff)
parent727c6742c29e46177951fdc8f6758085e03bb981 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: (23 commits) pcmcia: Fix ide-cs sparse warning pcmcia: ide-cs debugging bugfix pcmcia: allow for longer CIS firmware files pcmcia: cm40x0 cdev lock_kernel() pushdown pcmcia: (re)move {pcmcia,pccard}_get_status pcmcia: kill IN_CARD_SERVICES pcmcia: Remove unused header file code pcmcia: remove unused bulkmem.h pcmcia: simplify pccard_validate_cis pcmcia: carve out ioctl adjust function to pcmcia_ioctl pcmcia: irq probe can be done without risking an IRQ storm pcmcia: Fix ti12xx_2nd_slot_empty always failing pcmcia: check for pointer instead of pointer address pcmcia: switch cm4000_cs.c to unlocked_ioctl pcmcia: simplify rsrc_nonstatic attributes pcmcia: add support CompactFlash PCMCIA support for Blackfin. pcmcia: remove version.h pcmcia: cs: kill thread_wait pcmcia: i82365.c: check request_irq return value pcmcia: fix Alchemy warnings ...
Diffstat (limited to 'drivers/pcmcia/i82365.c')
-rw-r--r--drivers/pcmcia/i82365.c39
1 files changed, 27 insertions, 12 deletions
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index 32a2ab119798..68f6b2702bc4 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -1263,7 +1263,7 @@ static int __init init_i82365(void)
1263 1263
1264 ret = driver_register(&i82365_driver); 1264 ret = driver_register(&i82365_driver);
1265 if (ret) 1265 if (ret)
1266 return ret; 1266 goto err_out;
1267 1267
1268 i82365_device = platform_device_alloc("i82365", 0); 1268 i82365_device = platform_device_alloc("i82365", 0);
1269 if (i82365_device) { 1269 if (i82365_device) {
@@ -1273,10 +1273,8 @@ static int __init init_i82365(void)
1273 } else 1273 } else
1274 ret = -ENOMEM; 1274 ret = -ENOMEM;
1275 1275
1276 if (ret) { 1276 if (ret)
1277 driver_unregister(&i82365_driver); 1277 goto err_driver_unregister;
1278 return ret;
1279 }
1280 1278
1281 printk(KERN_INFO "Intel ISA PCIC probe: "); 1279 printk(KERN_INFO "Intel ISA PCIC probe: ");
1282 sockets = 0; 1280 sockets = 0;
@@ -1285,16 +1283,17 @@ static int __init init_i82365(void)
1285 1283
1286 if (sockets == 0) { 1284 if (sockets == 0) {
1287 printk("not found.\n"); 1285 printk("not found.\n");
1288 platform_device_unregister(i82365_device); 1286 ret = -ENODEV;
1289 release_region(i365_base, 2); 1287 goto err_dev_unregister;
1290 driver_unregister(&i82365_driver);
1291 return -ENODEV;
1292 } 1288 }
1293 1289
1294 /* Set up interrupt handler(s) */ 1290 /* Set up interrupt handler(s) */
1295 if (grab_irq != 0) 1291 if (grab_irq != 0)
1296 request_irq(cs_irq, pcic_interrupt, 0, "i82365", pcic_interrupt); 1292 ret = request_irq(cs_irq, pcic_interrupt, 0, "i82365", pcic_interrupt);
1297 1293
1294 if (ret)
1295 goto err_socket_release;
1296
1298 /* register sockets with the pcmcia core */ 1297 /* register sockets with the pcmcia core */
1299 for (i = 0; i < sockets; i++) { 1298 for (i = 0; i < sockets; i++) {
1300 socket[i].socket.dev.parent = &i82365_device->dev; 1299 socket[i].socket.dev.parent = &i82365_device->dev;
@@ -1324,7 +1323,23 @@ static int __init init_i82365(void)
1324 } 1323 }
1325 1324
1326 return 0; 1325 return 0;
1327 1326err_socket_release:
1327 for (i = 0; i < sockets; i++) {
1328 /* Turn off all interrupt sources! */
1329 i365_set(i, I365_CSCINT, 0);
1330 release_region(socket[i].ioaddr, 2);
1331 }
1332err_dev_unregister:
1333 platform_device_unregister(i82365_device);
1334 release_region(i365_base, 2);
1335#ifdef CONFIG_PNP
1336 if (i82365_pnpdev)
1337 pnp_disable_dev(i82365_pnpdev);
1338#endif
1339err_driver_unregister:
1340 driver_unregister(&i82365_driver);
1341err_out:
1342 return ret;
1328} /* init_i82365 */ 1343} /* init_i82365 */
1329 1344
1330static void __exit exit_i82365(void) 1345static void __exit exit_i82365(void)