diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2005-11-10 10:26:13 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2005-11-12 16:46:38 -0500 |
commit | dfb279c97510da659816f4f055146bb1f9f0a870 (patch) | |
tree | 0331d92f42f0d6746b85727b278ee799326853ff | |
parent | 9e6c67fd2716720d9029d38ea25884efcfdedeb6 (diff) |
[PCMCIA] i82365: use new platform_device helpers
Use the new platform_device helpers in the i82365 driver to get rid of the
"device 'i823650' does not have a release() function" warning, and to solve
bug #3676.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
-rw-r--r-- | drivers/pcmcia/i82365.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c index 4ddd76239b34..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 | ||
1342 | static struct platform_device i82365_device = { | 1342 | static struct platform_device *i82365_device; |
1343 | .name = "i82365", | ||
1344 | .id = 0, | ||
1345 | }; | ||
1346 | 1343 | ||
1347 | static int __init init_i82365(void) | 1344 | static 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,7 @@ 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); |
1369 | release_region(i365_base, 2); | 1373 | release_region(i365_base, 2); |
1370 | driver_unregister(&i82365_driver); | 1374 | driver_unregister(&i82365_driver); |
1371 | return -ENODEV; | 1375 | return -ENODEV; |
@@ -1377,7 +1381,7 @@ static int __init init_i82365(void) | |||
1377 | 1381 | ||
1378 | /* register sockets with the pcmcia core */ | 1382 | /* register sockets with the pcmcia core */ |
1379 | for (i = 0; i < sockets; i++) { | 1383 | for (i = 0; i < sockets; i++) { |
1380 | socket[i].socket.dev.dev = &i82365_device.dev; | 1384 | socket[i].socket.dev.dev = &i82365_device->dev; |
1381 | socket[i].socket.ops = &pcic_operations; | 1385 | socket[i].socket.ops = &pcic_operations; |
1382 | socket[i].socket.resource_ops = &pccard_nonstatic_ops; | 1386 | socket[i].socket.resource_ops = &pccard_nonstatic_ops; |
1383 | socket[i].socket.owner = THIS_MODULE; | 1387 | socket[i].socket.owner = THIS_MODULE; |
@@ -1415,7 +1419,7 @@ static void __exit exit_i82365(void) | |||
1415 | if (socket[i].flags & IS_REGISTERED) | 1419 | if (socket[i].flags & IS_REGISTERED) |
1416 | pcmcia_unregister_socket(&socket[i].socket); | 1420 | pcmcia_unregister_socket(&socket[i].socket); |
1417 | } | 1421 | } |
1418 | platform_device_unregister(&i82365_device); | 1422 | platform_device_unregister(i82365_device); |
1419 | if (poll_interval != 0) | 1423 | if (poll_interval != 0) |
1420 | del_timer_sync(&poll_timer); | 1424 | del_timer_sync(&poll_timer); |
1421 | if (grab_irq != 0) | 1425 | if (grab_irq != 0) |