aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/r8169.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 3acfeeabdee1..5e8ad634490f 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1705,18 +1705,18 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1705 1705
1706 rtl8169_print_mac_version(tp); 1706 rtl8169_print_mac_version(tp);
1707 1707
1708 for (i = ARRAY_SIZE(rtl_chip_info) - 1; i >= 0; i--) { 1708 for (i = 0; i < ARRAY_SIZE(rtl_chip_info); i++) {
1709 if (tp->mac_version == rtl_chip_info[i].mac_version) 1709 if (tp->mac_version == rtl_chip_info[i].mac_version)
1710 break; 1710 break;
1711 } 1711 }
1712 if (i < 0) { 1712 if (i == ARRAY_SIZE(rtl_chip_info)) {
1713 /* Unknown chip: assume array element #0, original RTL-8169 */ 1713 /* Unknown chip: assume array element #0, original RTL-8169 */
1714 if (netif_msg_probe(tp)) { 1714 if (netif_msg_probe(tp)) {
1715 dev_printk(KERN_DEBUG, &pdev->dev, 1715 dev_printk(KERN_DEBUG, &pdev->dev,
1716 "unknown chip version, assuming %s\n", 1716 "unknown chip version, assuming %s\n",
1717 rtl_chip_info[0].name); 1717 rtl_chip_info[0].name);
1718 } 1718 }
1719 i++; 1719 i = 0;
1720 } 1720 }
1721 tp->chipset = i; 1721 tp->chipset = i;
1722 1722