[PCMCIA] i82365: release all resources if no devices are found
[linux-3.10.git] / drivers / pcmcia / i82365.c
index a713015..4ddd762 100644 (file)
@@ -47,7 +47,7 @@
 #include <linux/delay.h>
 #include <linux/workqueue.h>
 #include <linux/interrupt.h>
-#include <linux/device.h>
+#include <linux/platform_device.h>
 #include <linux/bitops.h>
 #include <asm/irq.h>
 #include <asm/io.h>
@@ -1332,27 +1332,11 @@ static struct pccard_operations pcic_operations = {
 
 /*====================================================================*/
 
-static int i82365_suspend(struct device *dev, pm_message_t state, u32 level)
-{
-       int ret = 0;
-       if (level == SUSPEND_SAVE_STATE)
-               ret = pcmcia_socket_dev_suspend(dev, state);
-       return ret;
-}
-
-static int i82365_resume(struct device *dev, u32 level)
-{
-       int ret = 0;
-       if (level == RESUME_RESTORE_STATE)
-               ret = pcmcia_socket_dev_resume(dev);
-       return ret;
-}
-
 static struct device_driver i82365_driver = {
        .name = "i82365",
        .bus = &platform_bus_type,
-       .suspend = i82365_suspend,
-       .resume = i82365_resume,
+       .suspend = pcmcia_socket_dev_suspend,
+       .resume = pcmcia_socket_dev_resume,
 };
 
 static struct platform_device i82365_device = {
@@ -1382,6 +1366,7 @@ 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;
     }