aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/i82365.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/i82365.c')
-rw-r--r--drivers/pcmcia/i82365.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index 7ce455d01cc9..4d56bc9926d6 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -1339,10 +1339,7 @@ static struct device_driver i82365_driver = {
1339 .resume = pcmcia_socket_dev_resume, 1339 .resume = pcmcia_socket_dev_resume,
1340}; 1340};
1341 1341
1342static struct platform_device i82365_device = { 1342static struct platform_device *i82365_device;
1343 .name = "i82365",
1344 .id = 0,
1345};
1346 1343
1347static int __init init_i82365(void) 1344static int __init init_i82365(void)
1348{ 1345{
@@ -1352,7 +1349,14 @@ static int __init init_i82365(void)
1352 if (ret) 1349 if (ret)
1353 return ret; 1350 return ret;
1354 1351
1355 ret = platform_device_register(&i82365_device); 1352 i82365_device = platform_device_alloc("i82365", 0);
1353 if (i82365_device) {
1354 ret = platform_device_add(i82365_device);
1355 if (ret)
1356 platform_device_put(i82365_device);
1357 } else
1358 ret = -ENOMEM;
1359
1356 if (ret) { 1360 if (ret) {
1357 driver_unregister(&i82365_driver); 1361 driver_unregister(&i82365_driver);
1358 return ret; 1362 return ret;
@@ -1365,7 +1369,8 @@ static int __init init_i82365(void)
1365 1369
1366 if (sockets == 0) { 1370 if (sockets == 0) {
1367 printk("not found.\n"); 1371 printk("not found.\n");
1368 platform_device_unregister(&i82365_device); 1372 platform_device_unregister(i82365_device);
1373 release_region(i365_base, 2);
1369 driver_unregister(&i82365_driver); 1374 driver_unregister(&i82365_driver);
1370 return -ENODEV; 1375 return -ENODEV;
1371 } 1376 }
@@ -1376,7 +1381,7 @@ static int __init init_i82365(void)
1376 1381
1377 /* register sockets with the pcmcia core */ 1382 /* register sockets with the pcmcia core */
1378 for (i = 0; i < sockets; i++) { 1383 for (i = 0; i < sockets; i++) {
1379 socket[i].socket.dev.dev = &i82365_device.dev; 1384 socket[i].socket.dev.dev = &i82365_device->dev;
1380 socket[i].socket.ops = &pcic_operations; 1385 socket[i].socket.ops = &pcic_operations;
1381 socket[i].socket.resource_ops = &pccard_nonstatic_ops; 1386 socket[i].socket.resource_ops = &pccard_nonstatic_ops;
1382 socket[i].socket.owner = THIS_MODULE; 1387 socket[i].socket.owner = THIS_MODULE;
@@ -1414,7 +1419,7 @@ static void __exit exit_i82365(void)
1414 if (socket[i].flags & IS_REGISTERED) 1419 if (socket[i].flags & IS_REGISTERED)
1415 pcmcia_unregister_socket(&socket[i].socket); 1420 pcmcia_unregister_socket(&socket[i].socket);
1416 } 1421 }
1417 platform_device_unregister(&i82365_device); 1422 platform_device_unregister(i82365_device);
1418 if (poll_interval != 0) 1423 if (poll_interval != 0)
1419 del_timer_sync(&poll_timer); 1424 del_timer_sync(&poll_timer);
1420 if (grab_irq != 0) 1425 if (grab_irq != 0)