aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-02-26 06:24:03 -0500
committerJeff Garzik <jeff@garzik.org>2007-03-01 20:19:45 -0500
commite34bb370dec4919b7e8b769d51ad2bc2535b6982 (patch)
tree3fa5c0a00bfdb56a0bdf5974c0b3b61bf2ffa82c /drivers/pci
parent5ee2ae7fb2079c5775d8802cd282140d71632a2d (diff)
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')
-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
1220 */ 1220 */
1221static void quirk_jmicron_ata(struct pci_dev *pdev) 1221static void quirk_jmicron_ata(struct pci_dev *pdev)
1222{ 1222{
1223 u32 conf1, conf5; 1223 u32 conf1, conf5, class;
1224 u8 hdr; 1224 u8 hdr;
1225 1225
1226 /* Only poke fn 0 */ 1226 /* Only poke fn 0 */
@@ -1264,6 +1264,9 @@ static void quirk_jmicron_ata(struct pci_dev *pdev)
1264 pci_read_config_byte(pdev, PCI_HEADER_TYPE, &hdr); 1264 pci_read_config_byte(pdev, PCI_HEADER_TYPE, &hdr);
1265 pdev->hdr_type = hdr & 0x7f; 1265 pdev->hdr_type = hdr & 0x7f;
1266 pdev->multifunction = !!(hdr & 0x80); 1266 pdev->multifunction = !!(hdr & 0x80);
1267
1268 pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class);
1269 pdev->class = class >> 8;
1267} 1270}
1268DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB360, quirk_jmicron_ata); 1271DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB360, quirk_jmicron_ata);
1269DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, quirk_jmicron_ata); 1272DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, quirk_jmicron_ata);