]> git.itanic.dy.fi Git - linux-stable/commitdiff
ata: use pci_dev->revision
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Tue, 24 Nov 2009 18:54:49 +0000 (22:54 +0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 23 Jun 2011 22:24:08 +0000 (15:24 -0700)
commit 89d3b3603bfb648e0113d8682d4f84dd18a776bd upstream.

Some places were using PCI_CLASS_REVISION instead of PCI_REVISION_ID, so
they weren't converted by commit 44c10138fd4bbc4b6d6bff0873c24902f2a9da65
(PCI: Change all drivers to use pci_device->revision).

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/ata/pata_cmd64x.c
drivers/ata/pata_hpt366.c
drivers/ata/pata_hpt37x.c
drivers/ata/pata_hpt3x2n.c
drivers/ata/pata_sil680.c

index f0bad9be0f65ea8900d77b61c1299b4f8aeb9aea..0efb1f58f2551f4c0d905f0298791ebb744d3425 100644 (file)
@@ -294,8 +294,6 @@ static struct ata_port_operations cmd648_port_ops = {
 
 static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
 {
-       u32 class_rev;
-
        static const struct ata_port_info cmd_info[6] = {
                {       /* CMD 643 - no UDMA */
                        .flags = ATA_FLAG_SLAVE_POSS,
@@ -345,18 +343,15 @@ static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
        if (rc)
                return rc;
 
-       pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class_rev);
-       class_rev &= 0xFF;
-
        if (id->driver_data == 0)       /* 643 */
                ata_pci_bmdma_clear_simplex(pdev);
 
        if (pdev->device == PCI_DEVICE_ID_CMD_646) {
                /* Does UDMA work ? */
-               if (class_rev > 4)
+               if (pdev->revision > 4)
                        ppi[0] = &cmd_info[2];
                /* Early rev with other problems ? */
-               else if (class_rev == 1)
+               else if (pdev->revision == 1)
                        ppi[0] = &cmd_info[3];
        }
 
index d7f2da127d13a452f984c63000e27b0d3c02a71a..b9d88361a3129c7aabedc5676c8b4ab74f0c1f2c 100644 (file)
@@ -344,7 +344,6 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
        const struct ata_port_info *ppi[] = { &info_hpt366, NULL };
 
        void *hpriv = NULL;
-       u32 class_rev;
        u32 reg1;
        int rc;
 
@@ -352,13 +351,10 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
        if (rc)
                return rc;
 
-       pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
-       class_rev &= 0xFF;
-
        /* May be a later chip in disguise. Check */
        /* Newer chips are not in the HPT36x driver. Ignore them */
-       if (class_rev > 2)
-                       return -ENODEV;
+       if (dev->revision > 2)
+               return -ENODEV;
 
        hpt36x_init_chipset(dev);
 
index ec07c5378461c74b146d25493af20490e363f076..5af7f198d2a3d5c39d7d4b409b3bce59594616a5 100644 (file)
@@ -789,9 +789,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
        static const int MHz[4] = { 33, 40, 50, 66 };
        void *private_data = NULL;
        const struct ata_port_info *ppi[] = { NULL, NULL };
-
+       u8 rev = dev->revision;
        u8 irqmask;
-       u32 class_rev;
        u8 mcr1;
        u32 freq;
        int prefer_dpll = 1;
@@ -806,19 +805,16 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
        if (rc)
                return rc;
 
-       pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
-       class_rev &= 0xFF;
-
        if (dev->device == PCI_DEVICE_ID_TTI_HPT366) {
                /* May be a later chip in disguise. Check */
                /* Older chips are in the HPT366 driver. Ignore them */
-               if (class_rev < 3)
+               if (rev < 3)
                        return -ENODEV;
                /* N series chips have their own driver. Ignore */
-               if (class_rev == 6)
+               if (rev == 6)
                        return -ENODEV;
 
-               switch(class_rev) {
+               switch(rev) {
                        case 3:
                                ppi[0] = &info_hpt370;
                                chip_table = &hpt370;
@@ -834,28 +830,29 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                                chip_table = &hpt372;
                                break;
                        default:
-                               printk(KERN_ERR "pata_hpt37x: Unknown HPT366 subtype please report (%d).\n", class_rev);
+                               printk(KERN_ERR "pata_hpt37x: Unknown HPT366 "
+                                      "subtype, please report (%d).\n", rev);
                                return -ENODEV;
                }
        } else {
                switch(dev->device) {
                        case PCI_DEVICE_ID_TTI_HPT372:
                                /* 372N if rev >= 2*/
-                               if (class_rev >= 2)
+                               if (rev >= 2)
                                        return -ENODEV;
                                ppi[0] = &info_hpt372;
                                chip_table = &hpt372a;
                                break;
                        case PCI_DEVICE_ID_TTI_HPT302:
                                /* 302N if rev > 1 */
-                               if (class_rev > 1)
+                               if (rev > 1)
                                        return -ENODEV;
                                ppi[0] = &info_hpt372;
                                /* Check this */
                                chip_table = &hpt302;
                                break;
                        case PCI_DEVICE_ID_TTI_HPT371:
-                               if (class_rev > 1)
+                               if (rev > 1)
                                        return -ENODEV;
                                ppi[0] = &info_hpt372;
                                chip_table = &hpt371;
index d9f2913f159b3a086b6d1ce6c3d4d59bd6292bab..100f227e3c632a94b4d8764d27697245dcdb0635 100644 (file)
@@ -452,10 +452,8 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                .port_ops = &hpt3x2n_port_ops
        };
        const struct ata_port_info *ppi[] = { &info, NULL };
-
+       u8 rev = dev->revision;
        u8 irqmask;
-       u32 class_rev;
-
        unsigned int pci_mhz;
        unsigned int f_low, f_high;
        int adjust;
@@ -467,26 +465,23 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
        if (rc)
                return rc;
 
-       pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
-       class_rev &= 0xFF;
-
        switch(dev->device) {
                case PCI_DEVICE_ID_TTI_HPT366:
-                       if (class_rev < 6)
+                       if (rev < 6)
                                return -ENODEV;
                        break;
                case PCI_DEVICE_ID_TTI_HPT371:
-                       if (class_rev < 2)
+                       if (rev < 2)
                                return -ENODEV;
                        /* 371N if rev > 1 */
                        break;
                case PCI_DEVICE_ID_TTI_HPT372:
                        /* 372N if rev >= 2*/
-                       if (class_rev < 2)
+                       if (rev < 2)
                                return -ENODEV;
                        break;
                case PCI_DEVICE_ID_TTI_HPT302:
-                       if (class_rev < 2)
+                       if (rev < 2)
                                return -ENODEV;
                        break;
                case PCI_DEVICE_ID_TTI_HPT372N:
index 4cb649d8d38cbb603e719cac0938f42a068555f4..a2ace48a4610c2b627324088ea34c2520f068c5c 100644 (file)
@@ -212,13 +212,11 @@ static struct ata_port_operations sil680_port_ops = {
 
 static u8 sil680_init_chip(struct pci_dev *pdev, int *try_mmio)
 {
-       u32 class_rev   = 0;
        u8 tmpbyte      = 0;
 
-        pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class_rev);
-        class_rev &= 0xff;
         /* FIXME: double check */
-       pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, (class_rev) ? 1 : 255);
+       pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE,
+                             pdev->revision ? 1 : 255);
 
        pci_write_config_byte(pdev, 0x80, 0x00);
        pci_write_config_byte(pdev, 0x84, 0x00);