public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 2/3] pci: correctly initialize a structure
@ 2007-12-18  1:56 Shaohua Li
  2007-12-21  2:59 ` patch pci-correctly-initialize-a-structure-for-pcie_save_pcix_state.patch added to gregkh-2.6 tree gregkh
  0 siblings, 1 reply; 2+ messages in thread
From: Shaohua Li @ 2007-12-18  1:56 UTC (permalink / raw)
  To: lkml; +Cc: Andrew Morton, Greg KH

save_state->cap_nr should be correctly set, otherwise we can't find the
saved cap at resume.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>

Index: linux/drivers/pci/pci.c
===================================================================
--- linux.orig/drivers/pci/pci.c	2007-12-18 09:35:52.000000000 +0800
+++ linux/drivers/pci/pci.c	2007-12-18 09:36:40.000000000 +0800
@@ -569,6 +569,7 @@ static int pci_save_pcie_state(struct pc
 	pci_read_config_word(dev, pos + PCI_EXP_LNKCTL, &cap[i++]);
 	pci_read_config_word(dev, pos + PCI_EXP_SLTCTL, &cap[i++]);
 	pci_read_config_word(dev, pos + PCI_EXP_RTCTL, &cap[i++]);
+	save_state->cap_nr = PCI_CAP_ID_EXP;
 	pci_add_saved_cap(dev, save_state);
 	return 0;
 }
@@ -612,6 +613,7 @@ static int pci_save_pcix_state(struct pc
 	cap = (u16 *)&save_state->data[0];
 
 	pci_read_config_word(dev, pos + PCI_X_CMD, &cap[i++]);
+	save_state->cap_nr = PCI_CAP_ID_PCIX;
 	pci_add_saved_cap(dev, save_state);
 	return 0;
 }



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-12-21  3:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-18  1:56 [patch 2/3] pci: correctly initialize a structure Shaohua Li
2007-12-21  2:59 ` patch pci-correctly-initialize-a-structure-for-pcie_save_pcix_state.patch added to gregkh-2.6 tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox