projects/linux·commit f79b1b14

PCI: use fixed-up device class when configuring device

f79b1b14 · Yu Zhao <[email protected]> · 2009-05-28 00:25:05 +08:00

The device class may be changed after the fixup, so re-read the class
value from pci_dev when configuring the device.  Otherwise some devices
such as JMicron SATA controller won't work.

Reviewed-by: Matthew Wilcox <[email protected]>
Reviewed-by: Grant Grundler <[email protected]>
Tested-by: Marc Dionne <[email protected]>
Signed-off-by: Yu Zhao <[email protected]>
Signed-off-by: Jesse Barnes <[email protected]>
Commit
f79b1b146b52765ee38bfb91bb14eb850fa98017
Parents
9fa7eb28

Changes

1 files changed · +2 −0

FileStatusAddDelContent
drivers/pci/probe.cmodified+2−0View file

drivers/pci/probe.c

View file
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index e3c3e08..f1ae247 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -745,6 +745,8 @@ int pci_setup_device(struct pci_dev *dev)
/* Early fixups, before probing the BARs */
pci_fixup_device(pci_fixup_early, dev);
+ /* device class may be changed after fixup */
+ class = dev->class >> 8;
switch (dev->hdr_type) { /* header type */
case PCI_HEADER_TYPE_NORMAL: /* standard header */