summaryrefslogtreecommitdiffstats
path: root/drivers/pci/quirks.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-02-26 20:24:03 +0900
committerJeff Garzik <jeff@garzik.org>2007-03-01 20:19:45 -0500
commite34bb370dec4919b7e8b769d51ad2bc2535b6982 (patch)
tree3fa5c0a00bfdb56a0bdf5974c0b3b61bf2ffa82c /drivers/pci/quirks.c
parent5ee2ae7fb2079c5775d8802cd282140d71632a2d (diff)
downloadblackbird-op-linux-e34bb370dec4919b7e8b769d51ad2bc2535b6982.tar.gz
blackbird-op-linux-e34bb370dec4919b7e8b769d51ad2bc2535b6982.zip
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 <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r--drivers/pci/quirks.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 1e6e1e4d3327..1bf548287564 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -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);
OpenPOWER on IntegriCloud