]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pcmcia/ds.c
slub: Remove objsize check in kmem_cache_flags()
[linux-2.6-omap-h63xx.git] / drivers / pcmcia / ds.c
index 15c18f5246d6d21bbd2c849892ef0f88d536395c..5a85871f5ee919ff3bdb18f10be8715132b037de 100644 (file)
@@ -865,11 +865,12 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
        ds_dbg(1, "trying to load CIS file %s\n", filename);
 
        if (strlen(filename) > 14) {
-               printk(KERN_WARNING "pcmcia: CIS filename is too long\n");
+               printk(KERN_WARNING "pcmcia: CIS filename is too long [%s]\n",
+                       filename);
                return -EINVAL;
        }
 
-       snprintf(path, 20, "%s", filename);
+       snprintf(path, sizeof(path), "%s", filename);
 
        if (request_firmware(&fw, path, &dev->dev) == 0) {
                if (fw->size >= CISTPL_MAX_CIS_SIZE) {
@@ -1130,8 +1131,6 @@ static int runtime_suspend(struct device *dev)
        down(&dev->sem);
        rc = pcmcia_dev_suspend(dev, PMSG_SUSPEND);
        up(&dev->sem);
-       if (!rc)
-               dev->power.power_state.event = PM_EVENT_SUSPEND;
        return rc;
 }
 
@@ -1142,8 +1141,6 @@ static void runtime_resume(struct device *dev)
        down(&dev->sem);
        rc = pcmcia_dev_resume(dev);
        up(&dev->sem);
-       if (!rc)
-               dev->power.power_state.event = PM_EVENT_ON;
 }
 
 /************************ per-device sysfs output ***************************/
@@ -1265,6 +1262,9 @@ static int pcmcia_dev_suspend(struct device * dev, pm_message_t state)
        struct pcmcia_driver *p_drv = NULL;
        int ret = 0;
 
+       if (p_dev->suspended)
+               return 0;
+
        ds_dbg(2, "suspending %s\n", dev->bus_id);
 
        if (dev->driver)
@@ -1301,6 +1301,9 @@ static int pcmcia_dev_resume(struct device * dev)
         struct pcmcia_driver *p_drv = NULL;
        int ret = 0;
 
+       if (!p_dev->suspended)
+               return 0;
+
        ds_dbg(2, "resuming %s\n", dev->bus_id);
 
        if (dev->driver)