[SCSI] atp870u, mpt2sas, qla4xxx use pci_dev->revision
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Wed, 14 Mar 2012 19:04:30 +0000 (22:04 +0300)
committerJames Bottomley <JBottomley@Parallels.com>
Wed, 28 Mar 2012 13:36:37 +0000 (14:36 +0100)
commit 44c10138fd4bbc4b6d6bff0873c24902f2a9da65 (PCI: Change all
drivers to use pci_device->revision) converted all drivers to use
pci_dev->revision.  Convert these three drivers which got missed.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/atp870u.c
drivers/scsi/mpt2sas/mpt2sas_base.c
drivers/scsi/mpt2sas/mpt2sas_ctl.c
drivers/scsi/qla4xxx/ql4_os.c

index 7e6eca4a125e91f75c55280dbbc34ee3d03a9010..a9561fb143f301c045f3e74b168204941d24b786 100644 (file)
@@ -2583,7 +2583,7 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
         * this than via the PCI device table
         */
        if (ent->device == PCI_DEVICE_ID_ARTOP_AEC7610) {
-               error = pci_read_config_byte(pdev, PCI_CLASS_REVISION, &atpdev->chip_ver);
+               atpdev->chip_ver = pdev->revision;
                if (atpdev->chip_ver < 2)
                        goto err_eio;
        }
@@ -2602,7 +2602,7 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        base_io &= 0xfffffff8;
 
        if ((ent->device == ATP880_DEVID1)||(ent->device == ATP880_DEVID2)) {
-               error = pci_read_config_byte(pdev, PCI_CLASS_REVISION, &atpdev->chip_ver);
+               atpdev->chip_ver = pdev->revision;
                pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x80);//JCC082803
 
                host_id = inb(base_io + 0x39);
index 921c818a92268dd4f9e837baea8899bc1f37b052..c42372c6f2461c42c7e769481f17ed346741fd20 100644 (file)
@@ -2060,12 +2060,10 @@ _base_display_ioc_capabilities(struct MPT2SAS_ADAPTER *ioc)
 {
        int i = 0;
        char desc[16];
-       u8 revision;
        u32 iounit_pg1_flags;
        u32 bios_version;
 
        bios_version = le32_to_cpu(ioc->bios_pg3.BiosVersion);
-       pci_read_config_byte(ioc->pdev, PCI_CLASS_REVISION, &revision);
        strncpy(desc, ioc->manu_pg0.ChipName, 16);
        printk(MPT2SAS_INFO_FMT "%s: FWVersion(%02d.%02d.%02d.%02d), "
           "ChipRevision(0x%02x), BiosVersion(%02d.%02d.%02d.%02d)\n",
@@ -2074,7 +2072,7 @@ _base_display_ioc_capabilities(struct MPT2SAS_ADAPTER *ioc)
           (ioc->facts.FWVersion.Word & 0x00FF0000) >> 16,
           (ioc->facts.FWVersion.Word & 0x0000FF00) >> 8,
           ioc->facts.FWVersion.Word & 0x000000FF,
-          revision,
+          ioc->pdev->revision,
           (bios_version & 0xFF000000) >> 24,
           (bios_version & 0x00FF0000) >> 16,
           (bios_version & 0x0000FF00) >> 8,
index 7fceb899029ed990b7b19dde1c22491ad29a4dc5..3b9a28efea8281fe85b5c5c1e4757da60f5cf061 100644 (file)
@@ -1026,7 +1026,6 @@ _ctl_getiocinfo(void __user *arg)
 {
        struct mpt2_ioctl_iocinfo karg;
        struct MPT2SAS_ADAPTER *ioc;
-       u8 revision;
 
        if (copy_from_user(&karg, arg, sizeof(karg))) {
                printk(KERN_ERR "failure at %s:%d/%s()!\n",
@@ -1046,8 +1045,7 @@ _ctl_getiocinfo(void __user *arg)
                karg.adapter_type = MPT2_IOCTL_INTERFACE_SAS2;
        if (ioc->pfacts)
                karg.port_number = ioc->pfacts[0].PortNumber;
-       pci_read_config_byte(ioc->pdev, PCI_CLASS_REVISION, &revision);
-       karg.hw_rev = revision;
+       karg.hw_rev = ioc->pdev->revision;
        karg.pci_id = ioc->pdev->device;
        karg.subsystem_device = ioc->pdev->subsystem_device;
        karg.subsystem_vendor = ioc->pdev->subsystem_vendor;
index 4c2f88465597986af13a559ba3d2ec05c86772fe..ee47820c30a6591824cfa42abff426fb09114e7b 100644 (file)
@@ -3445,7 +3445,6 @@ static void qla4xxx_free_adapter(struct scsi_qla_host *ha)
 int qla4_8xxx_iospace_config(struct scsi_qla_host *ha)
 {
        int status = 0;
-       uint8_t revision_id;
        unsigned long mem_base, mem_len, db_base, db_len;
        struct pci_dev *pdev = ha->pdev;
 
@@ -3457,10 +3456,9 @@ int qla4_8xxx_iospace_config(struct scsi_qla_host *ha)
                goto iospace_error_exit;
        }
 
-       pci_read_config_byte(pdev, PCI_REVISION_ID, &revision_id);
        DEBUG2(printk(KERN_INFO "%s: revision-id=%d\n",
-           __func__, revision_id));
-       ha->revision_id = revision_id;
+           __func__, pdev->revision));
+       ha->revision_id = pdev->revision;
 
        /* remap phys address */
        mem_base = pci_resource_start(pdev, 0); /* 0 is for BAR 0 */