mlx4: use pci_dev->revision
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Thu, 23 Jun 2011 04:44:30 +0000 (04:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Jun 2011 03:30:47 +0000 (20:30 -0700)
Commit 725c89997e03d71b09ea3c17c997da0712b9d835 (mlx4_en: Reporting HW revision
in ethtool -i) added code to read the revision ID from the PCI configuration
register while it's already stored by PCI subsystem in the 'revision' field of
'struct pci_dev'...

While at it, move the code being changed a bit in order to not break the
initialization sequence.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/mlx4/main.c

index 3814fc9b1145d50fc6fe25426436f895d9010b63..0cb0431ee19c459415f3ce4154cae1cc74654360 100644 (file)
@@ -1230,11 +1230,11 @@ static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
        INIT_LIST_HEAD(&priv->pgdir_list);
        mutex_init(&priv->pgdir_mutex);
 
-       pci_read_config_byte(pdev, PCI_REVISION_ID, &dev->rev_id);
-
        INIT_LIST_HEAD(&priv->bf_list);
        mutex_init(&priv->bf_mutex);
 
+       dev->rev_id = pdev->revision;
+
        /*
         * Now reset the HCA before we touch the PCI capabilities or
         * attempt a firmware command, since a boot ROM may have left