Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f79b1b14 authored by Yu Zhao's avatar Yu Zhao Committed by Jesse Barnes
Browse files

PCI: use fixed-up device class when configuring device



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: default avatarMatthew Wilcox <willy@linux.intel.com>
Reviewed-by: default avatarGrant Grundler <grundler@parisc-linux.org>
Tested-by: default avatarMarc Dionne <marc.c.dionne@gmail.com>
Signed-off-by: default avatarYu Zhao <yu.zhao@intel.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 9fa7eb28
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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 */