mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
ahci/pata_jmicron: match class not function number
Make jmiron_ata quirk update pdev->class after programming the device and update ahci and pata_jmicron such that they match class code instead of checking function number manually. For ahci, it matches for vendor and class. For pata_jmicron, it matches vendor, device and class as IDE class isn't as well defined as AHCI class. This makes jmicron device matching more conventional and script friendly. Signed-off-by: Tejun Heo <[email protected]> Signed-off-by: Jeff Garzik <[email protected]>
This commit is contained in:
parent
5ee2ae7fb2
commit
e34bb370de
3 changed files with 17 additions and 23 deletions
|
|
@ -1220,7 +1220,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, asus_hides_a
|
|||
*/
|
||||
static void quirk_jmicron_ata(struct pci_dev *pdev)
|
||||
{
|
||||
u32 conf1, conf5;
|
||||
u32 conf1, conf5, class;
|
||||
u8 hdr;
|
||||
|
||||
/* Only poke fn 0 */
|
||||
|
|
@ -1264,6 +1264,9 @@ static void quirk_jmicron_ata(struct pci_dev *pdev)
|
|||
pci_read_config_byte(pdev, PCI_HEADER_TYPE, &hdr);
|
||||
pdev->hdr_type = hdr & 0x7f;
|
||||
pdev->multifunction = !!(hdr & 0x80);
|
||||
|
||||
pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class);
|
||||
pdev->class = class >> 8;
|
||||
}
|
||||
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB360, quirk_jmicron_ata);
|
||||
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, quirk_jmicron_ata);
|
||||
|
|
|
|||
Loading…
Reference in a new issue