diff options
Diffstat (limited to 'drivers/pcmcia/yenta_socket.c')
-rw-r--r-- | drivers/pcmcia/yenta_socket.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 26229d9da762..da471bddc972 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c | |||
@@ -1197,8 +1197,12 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i | |||
1197 | ret = pcmcia_register_socket(&socket->socket); | 1197 | ret = pcmcia_register_socket(&socket->socket); |
1198 | if (ret == 0) { | 1198 | if (ret == 0) { |
1199 | /* Add the yenta register attributes */ | 1199 | /* Add the yenta register attributes */ |
1200 | device_create_file(&dev->dev, &dev_attr_yenta_registers); | 1200 | ret = device_create_file(&dev->dev, &dev_attr_yenta_registers); |
1201 | goto out; | 1201 | if (ret == 0) |
1202 | goto out; | ||
1203 | |||
1204 | /* error path... */ | ||
1205 | pcmcia_unregister_socket(&socket->socket); | ||
1202 | } | 1206 | } |
1203 | 1207 | ||
1204 | unmap: | 1208 | unmap: |
@@ -1213,7 +1217,7 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i | |||
1213 | return ret; | 1217 | return ret; |
1214 | } | 1218 | } |
1215 | 1219 | ||
1216 | 1220 | #ifdef CONFIG_PM | |
1217 | static int yenta_dev_suspend (struct pci_dev *dev, pm_message_t state) | 1221 | static int yenta_dev_suspend (struct pci_dev *dev, pm_message_t state) |
1218 | { | 1222 | { |
1219 | struct yenta_socket *socket = pci_get_drvdata(dev); | 1223 | struct yenta_socket *socket = pci_get_drvdata(dev); |
@@ -1248,12 +1252,18 @@ static int yenta_dev_resume (struct pci_dev *dev) | |||
1248 | struct yenta_socket *socket = pci_get_drvdata(dev); | 1252 | struct yenta_socket *socket = pci_get_drvdata(dev); |
1249 | 1253 | ||
1250 | if (socket) { | 1254 | if (socket) { |
1255 | int rc; | ||
1256 | |||
1251 | pci_set_power_state(dev, 0); | 1257 | pci_set_power_state(dev, 0); |
1252 | /* FIXME: pci_restore_state needs to have a better interface */ | 1258 | /* FIXME: pci_restore_state needs to have a better interface */ |
1253 | pci_restore_state(dev); | 1259 | pci_restore_state(dev); |
1254 | pci_write_config_dword(dev, 16*4, socket->saved_state[0]); | 1260 | pci_write_config_dword(dev, 16*4, socket->saved_state[0]); |
1255 | pci_write_config_dword(dev, 17*4, socket->saved_state[1]); | 1261 | pci_write_config_dword(dev, 17*4, socket->saved_state[1]); |
1256 | pci_enable_device(dev); | 1262 | |
1263 | rc = pci_enable_device(dev); | ||
1264 | if (rc) | ||
1265 | return rc; | ||
1266 | |||
1257 | pci_set_master(dev); | 1267 | pci_set_master(dev); |
1258 | 1268 | ||
1259 | if (socket->type && socket->type->restore_state) | 1269 | if (socket->type && socket->type->restore_state) |
@@ -1262,7 +1272,7 @@ static int yenta_dev_resume (struct pci_dev *dev) | |||
1262 | 1272 | ||
1263 | return pcmcia_socket_dev_resume(&dev->dev); | 1273 | return pcmcia_socket_dev_resume(&dev->dev); |
1264 | } | 1274 | } |
1265 | 1275 | #endif | |
1266 | 1276 | ||
1267 | #define CB_ID(vend,dev,type) \ | 1277 | #define CB_ID(vend,dev,type) \ |
1268 | { \ | 1278 | { \ |
@@ -1359,8 +1369,10 @@ static struct pci_driver yenta_cardbus_driver = { | |||
1359 | .id_table = yenta_table, | 1369 | .id_table = yenta_table, |
1360 | .probe = yenta_probe, | 1370 | .probe = yenta_probe, |
1361 | .remove = __devexit_p(yenta_close), | 1371 | .remove = __devexit_p(yenta_close), |
1372 | #ifdef CONFIG_PM | ||
1362 | .suspend = yenta_dev_suspend, | 1373 | .suspend = yenta_dev_suspend, |
1363 | .resume = yenta_dev_resume, | 1374 | .resume = yenta_dev_resume, |
1375 | #endif | ||
1364 | }; | 1376 | }; |
1365 | 1377 | ||
1366 | 1378 | ||