aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/ds.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2008-02-06 11:04:00 -0500
committerSteve French <sfrench@us.ibm.com>2008-02-06 11:04:00 -0500
commitf315ccb3e679f271583f2a4f463ad9b65665b751 (patch)
tree44eb52102587d7b0bb592464cef6ec04bcac8b90 /drivers/pcmcia/ds.c
parentead03e30b050d6dda769e7e9b071c5fa720bf8d2 (diff)
parent551e4fb2465b87de9d4aa1669b27d624435443bb (diff)
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r--drivers/pcmcia/ds.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 15c18f5246d6..5a85871f5ee9 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -865,11 +865,12 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
865 ds_dbg(1, "trying to load CIS file %s\n", filename); 865 ds_dbg(1, "trying to load CIS file %s\n", filename);
866 866
867 if (strlen(filename) > 14) { 867 if (strlen(filename) > 14) {
868 printk(KERN_WARNING "pcmcia: CIS filename is too long\n"); 868 printk(KERN_WARNING "pcmcia: CIS filename is too long [%s]\n",
869 filename);
869 return -EINVAL; 870 return -EINVAL;
870 } 871 }
871 872
872 snprintf(path, 20, "%s", filename); 873 snprintf(path, sizeof(path), "%s", filename);
873 874
874 if (request_firmware(&fw, path, &dev->dev) == 0) { 875 if (request_firmware(&fw, path, &dev->dev) == 0) {
875 if (fw->size >= CISTPL_MAX_CIS_SIZE) { 876 if (fw->size >= CISTPL_MAX_CIS_SIZE) {
@@ -1130,8 +1131,6 @@ static int runtime_suspend(struct device *dev)
1130 down(&dev->sem); 1131 down(&dev->sem);
1131 rc = pcmcia_dev_suspend(dev, PMSG_SUSPEND); 1132 rc = pcmcia_dev_suspend(dev, PMSG_SUSPEND);
1132 up(&dev->sem); 1133 up(&dev->sem);
1133 if (!rc)
1134 dev->power.power_state.event = PM_EVENT_SUSPEND;
1135 return rc; 1134 return rc;
1136} 1135}
1137 1136
@@ -1142,8 +1141,6 @@ static void runtime_resume(struct device *dev)
1142 down(&dev->sem); 1141 down(&dev->sem);
1143 rc = pcmcia_dev_resume(dev); 1142 rc = pcmcia_dev_resume(dev);
1144 up(&dev->sem); 1143 up(&dev->sem);
1145 if (!rc)
1146 dev->power.power_state.event = PM_EVENT_ON;
1147} 1144}
1148 1145
1149/************************ per-device sysfs output ***************************/ 1146/************************ per-device sysfs output ***************************/
@@ -1265,6 +1262,9 @@ static int pcmcia_dev_suspend(struct device * dev, pm_message_t state)
1265 struct pcmcia_driver *p_drv = NULL; 1262 struct pcmcia_driver *p_drv = NULL;
1266 int ret = 0; 1263 int ret = 0;
1267 1264
1265 if (p_dev->suspended)
1266 return 0;
1267
1268 ds_dbg(2, "suspending %s\n", dev->bus_id); 1268 ds_dbg(2, "suspending %s\n", dev->bus_id);
1269 1269
1270 if (dev->driver) 1270 if (dev->driver)
@@ -1301,6 +1301,9 @@ static int pcmcia_dev_resume(struct device * dev)
1301 struct pcmcia_driver *p_drv = NULL; 1301 struct pcmcia_driver *p_drv = NULL;
1302 int ret = 0; 1302 int ret = 0;
1303 1303
1304 if (!p_dev->suspended)
1305 return 0;
1306
1304 ds_dbg(2, "resuming %s\n", dev->bus_id); 1307 ds_dbg(2, "resuming %s\n", dev->bus_id);
1305 1308
1306 if (dev->driver) 1309 if (dev->driver)