diff options
Diffstat (limited to 'drivers/pci/msi.c')
-rw-r--r-- | drivers/pci/msi.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 6cfa6be9a6d5..067ae9917fd6 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -295,7 +295,7 @@ static int msi_lookup_irq(struct pci_dev *dev, int type) | |||
295 | } | 295 | } |
296 | 296 | ||
297 | #ifdef CONFIG_PM | 297 | #ifdef CONFIG_PM |
298 | int pci_save_msi_state(struct pci_dev *dev) | 298 | static int __pci_save_msi_state(struct pci_dev *dev) |
299 | { | 299 | { |
300 | int pos, i = 0; | 300 | int pos, i = 0; |
301 | u16 control; | 301 | u16 control; |
@@ -333,7 +333,7 @@ int pci_save_msi_state(struct pci_dev *dev) | |||
333 | return 0; | 333 | return 0; |
334 | } | 334 | } |
335 | 335 | ||
336 | void pci_restore_msi_state(struct pci_dev *dev) | 336 | static void __pci_restore_msi_state(struct pci_dev *dev) |
337 | { | 337 | { |
338 | int i = 0, pos; | 338 | int i = 0, pos; |
339 | u16 control; | 339 | u16 control; |
@@ -361,7 +361,7 @@ void pci_restore_msi_state(struct pci_dev *dev) | |||
361 | kfree(save_state); | 361 | kfree(save_state); |
362 | } | 362 | } |
363 | 363 | ||
364 | int pci_save_msix_state(struct pci_dev *dev) | 364 | static int __pci_save_msix_state(struct pci_dev *dev) |
365 | { | 365 | { |
366 | int pos; | 366 | int pos; |
367 | int temp; | 367 | int temp; |
@@ -409,7 +409,20 @@ int pci_save_msix_state(struct pci_dev *dev) | |||
409 | return 0; | 409 | return 0; |
410 | } | 410 | } |
411 | 411 | ||
412 | void pci_restore_msix_state(struct pci_dev *dev) | 412 | int pci_save_msi_state(struct pci_dev *dev) |
413 | { | ||
414 | int rc; | ||
415 | |||
416 | rc = __pci_save_msi_state(dev); | ||
417 | if (rc) | ||
418 | return rc; | ||
419 | |||
420 | rc = __pci_save_msix_state(dev); | ||
421 | |||
422 | return rc; | ||
423 | } | ||
424 | |||
425 | static void __pci_restore_msix_state(struct pci_dev *dev) | ||
413 | { | 426 | { |
414 | u16 save; | 427 | u16 save; |
415 | int pos; | 428 | int pos; |
@@ -446,6 +459,12 @@ void pci_restore_msix_state(struct pci_dev *dev) | |||
446 | pci_write_config_word(dev, msi_control_reg(pos), save); | 459 | pci_write_config_word(dev, msi_control_reg(pos), save); |
447 | enable_msi_mode(dev, pos, PCI_CAP_ID_MSIX); | 460 | enable_msi_mode(dev, pos, PCI_CAP_ID_MSIX); |
448 | } | 461 | } |
462 | |||
463 | void pci_restore_msi_state(struct pci_dev *dev) | ||
464 | { | ||
465 | __pci_restore_msi_state(dev); | ||
466 | __pci_restore_msix_state(dev); | ||
467 | } | ||
449 | #endif /* CONFIG_PM */ | 468 | #endif /* CONFIG_PM */ |
450 | 469 | ||
451 | /** | 470 | /** |