aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sundance.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2005-10-18 21:31:01 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-10-18 22:29:14 -0400
commit67ec2f805a5260c041b1c3c7a86ecfbc9670db06 (patch)
tree5cfe4895d39172cdc8afa192932d436322ca3be7 /drivers/net/sundance.c
parent36841c9d02870983c2b08c85d56572c1ff011997 (diff)
[PATCH] sundance: remove if (1) { ... } block in sundance_probe1
Remove an if (1) { ... } block in sundance_probe1. Its purpose seems to be only to allow for delaring some extra local variables. But, it also adds ugly indentation without adding any meaning to the code. Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/sundance.c')
-rw-r--r--drivers/net/sundance.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index e148a7212073..8c4eb11ab44e 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -518,6 +518,7 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
518#else 518#else
519 int bar = 1; 519 int bar = 1;
520#endif 520#endif
521 int phy, phy_idx = 0;
521 522
522 523
523/* when built into the kernel, we only print version if device is found */ 524/* when built into the kernel, we only print version if device is found */
@@ -606,33 +607,30 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
606 printk("%2.2x:", dev->dev_addr[i]); 607 printk("%2.2x:", dev->dev_addr[i]);
607 printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], irq); 608 printk("%2.2x, IRQ %d.\n", dev->dev_addr[i], irq);
608 609
609 if (1) { 610 np->phys[0] = 1; /* Default setting */
610 int phy, phy_idx = 0; 611 np->mii_preamble_required++;
611 np->phys[0] = 1; /* Default setting */ 612 for (phy = 1; phy < 32 && phy_idx < MII_CNT; phy++) {
612 np->mii_preamble_required++; 613 int mii_status = mdio_read(dev, phy, MII_BMSR);
613 for (phy = 1; phy < 32 && phy_idx < MII_CNT; phy++) { 614 if (mii_status != 0xffff && mii_status != 0x0000) {
614 int mii_status = mdio_read(dev, phy, MII_BMSR); 615 np->phys[phy_idx++] = phy;
615 if (mii_status != 0xffff && mii_status != 0x0000) { 616 np->mii_if.advertising = mdio_read(dev, phy, MII_ADVERTISE);
616 np->phys[phy_idx++] = phy; 617 if ((mii_status & 0x0040) == 0)
617 np->mii_if.advertising = mdio_read(dev, phy, MII_ADVERTISE); 618 np->mii_preamble_required++;
618 if ((mii_status & 0x0040) == 0) 619 printk(KERN_INFO "%s: MII PHY found at address %d, status "
619 np->mii_preamble_required++; 620 "0x%4.4x advertising %4.4x.\n",
620 printk(KERN_INFO "%s: MII PHY found at address %d, status " 621 dev->name, phy, mii_status, np->mii_if.advertising);
621 "0x%4.4x advertising %4.4x.\n",
622 dev->name, phy, mii_status, np->mii_if.advertising);
623 }
624 }
625 np->mii_preamble_required--;
626
627 if (phy_idx == 0) {
628 printk(KERN_INFO "%s: No MII transceiver found, aborting. ASIC status %x\n",
629 dev->name, ioread32(ioaddr + ASICCtrl));
630 goto err_out_unregister;
631 } 622 }
623 }
624 np->mii_preamble_required--;
632 625
633 np->mii_if.phy_id = np->phys[0]; 626 if (phy_idx == 0) {
627 printk(KERN_INFO "%s: No MII transceiver found, aborting. ASIC status %x\n",
628 dev->name, ioread32(ioaddr + ASICCtrl));
629 goto err_out_unregister;
634 } 630 }
635 631
632 np->mii_if.phy_id = np->phys[0];
633
636 /* Parse override configuration */ 634 /* Parse override configuration */
637 np->an_enable = 1; 635 np->an_enable = 1;
638 if (card_idx < MAX_UNITS) { 636 if (card_idx < MAX_UNITS) {