diff options
Diffstat (limited to 'drivers/ata/pata_cmd640.c')
-rw-r--r-- | drivers/ata/pata_cmd640.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/ata/pata_cmd640.c b/drivers/ata/pata_cmd640.c index 43d198f90968..0ef1d1ded1f8 100644 --- a/drivers/ata/pata_cmd640.c +++ b/drivers/ata/pata_cmd640.c | |||
@@ -254,20 +254,31 @@ static int cmd640_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
254 | .port_ops = &cmd640_port_ops | 254 | .port_ops = &cmd640_port_ops |
255 | }; | 255 | }; |
256 | const struct ata_port_info *ppi[] = { &info, NULL }; | 256 | const struct ata_port_info *ppi[] = { &info, NULL }; |
257 | int rc; | ||
258 | |||
259 | rc = pcim_enable_device(pdev); | ||
260 | if (rc) | ||
261 | return rc; | ||
257 | 262 | ||
258 | cmd640_hardware_init(pdev); | 263 | cmd640_hardware_init(pdev); |
264 | |||
259 | return ata_pci_init_one(pdev, ppi); | 265 | return ata_pci_init_one(pdev, ppi); |
260 | } | 266 | } |
261 | 267 | ||
268 | #ifdef CONFIG_PM | ||
262 | static int cmd640_reinit_one(struct pci_dev *pdev) | 269 | static int cmd640_reinit_one(struct pci_dev *pdev) |
263 | { | 270 | { |
271 | struct ata_host *host = dev_get_drvdata(&pdev->dev); | ||
272 | int rc; | ||
273 | |||
274 | rc = ata_pci_device_do_resume(pdev); | ||
275 | if (rc) | ||
276 | return rc; | ||
264 | cmd640_hardware_init(pdev); | 277 | cmd640_hardware_init(pdev); |
265 | #ifdef CONFIG_PM | 278 | ata_host_resume(host); |
266 | return ata_pci_device_resume(pdev); | ||
267 | #else | ||
268 | return 0; | 279 | return 0; |
269 | #endif | ||
270 | } | 280 | } |
281 | #endif | ||
271 | 282 | ||
272 | static const struct pci_device_id cmd640[] = { | 283 | static const struct pci_device_id cmd640[] = { |
273 | { PCI_VDEVICE(CMD, 0x640), 0 }, | 284 | { PCI_VDEVICE(CMD, 0x640), 0 }, |
@@ -281,8 +292,8 @@ static struct pci_driver cmd640_pci_driver = { | |||
281 | .remove = ata_pci_remove_one, | 292 | .remove = ata_pci_remove_one, |
282 | #ifdef CONFIG_PM | 293 | #ifdef CONFIG_PM |
283 | .suspend = ata_pci_device_suspend, | 294 | .suspend = ata_pci_device_suspend, |
284 | #endif | ||
285 | .resume = cmd640_reinit_one, | 295 | .resume = cmd640_reinit_one, |
296 | #endif | ||
286 | }; | 297 | }; |
287 | 298 | ||
288 | static int __init cmd640_init(void) | 299 | static int __init cmd640_init(void) |