diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pci.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 53302cbdb94c..d6e5b8ea9194 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -830,7 +830,7 @@ static int pci_save_pcie_state(struct pci_dev *dev) | |||
830 | dev_err(&dev->dev, "buffer not found in %s\n", __func__); | 830 | dev_err(&dev->dev, "buffer not found in %s\n", __func__); |
831 | return -ENOMEM; | 831 | return -ENOMEM; |
832 | } | 832 | } |
833 | cap = (u16 *)&save_state->data[0]; | 833 | cap = (u16 *)&save_state->cap.data[0]; |
834 | 834 | ||
835 | pci_read_config_word(dev, pos + PCI_EXP_FLAGS, &flags); | 835 | pci_read_config_word(dev, pos + PCI_EXP_FLAGS, &flags); |
836 | 836 | ||
@@ -863,7 +863,7 @@ static void pci_restore_pcie_state(struct pci_dev *dev) | |||
863 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); | 863 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); |
864 | if (!save_state || pos <= 0) | 864 | if (!save_state || pos <= 0) |
865 | return; | 865 | return; |
866 | cap = (u16 *)&save_state->data[0]; | 866 | cap = (u16 *)&save_state->cap.data[0]; |
867 | 867 | ||
868 | pci_read_config_word(dev, pos + PCI_EXP_FLAGS, &flags); | 868 | pci_read_config_word(dev, pos + PCI_EXP_FLAGS, &flags); |
869 | 869 | ||
@@ -899,7 +899,8 @@ static int pci_save_pcix_state(struct pci_dev *dev) | |||
899 | return -ENOMEM; | 899 | return -ENOMEM; |
900 | } | 900 | } |
901 | 901 | ||
902 | pci_read_config_word(dev, pos + PCI_X_CMD, (u16 *)save_state->data); | 902 | pci_read_config_word(dev, pos + PCI_X_CMD, |
903 | (u16 *)save_state->cap.data); | ||
903 | 904 | ||
904 | return 0; | 905 | return 0; |
905 | } | 906 | } |
@@ -914,7 +915,7 @@ static void pci_restore_pcix_state(struct pci_dev *dev) | |||
914 | pos = pci_find_capability(dev, PCI_CAP_ID_PCIX); | 915 | pos = pci_find_capability(dev, PCI_CAP_ID_PCIX); |
915 | if (!save_state || pos <= 0) | 916 | if (!save_state || pos <= 0) |
916 | return; | 917 | return; |
917 | cap = (u16 *)&save_state->data[0]; | 918 | cap = (u16 *)&save_state->cap.data[0]; |
918 | 919 | ||
919 | pci_write_config_word(dev, pos + PCI_X_CMD, cap[i++]); | 920 | pci_write_config_word(dev, pos + PCI_X_CMD, cap[i++]); |
920 | } | 921 | } |
@@ -1771,7 +1772,8 @@ static int pci_add_cap_save_buffer( | |||
1771 | if (!save_state) | 1772 | if (!save_state) |
1772 | return -ENOMEM; | 1773 | return -ENOMEM; |
1773 | 1774 | ||
1774 | save_state->cap_nr = cap; | 1775 | save_state->cap.cap_nr = cap; |
1776 | save_state->cap.size = size; | ||
1775 | pci_add_saved_cap(dev, save_state); | 1777 | pci_add_saved_cap(dev, save_state); |
1776 | 1778 | ||
1777 | return 0; | 1779 | return 0; |