diff options
author | Matt Carlson <mcarlson@broadcom.com> | 2010-04-05 06:19:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-06 06:58:00 -0400 |
commit | ab96b241fd82ec8d546684ab6e29b6530976780a (patch) | |
tree | 29083d52cf9e6a725e36614e0c39f32657630012 /drivers/net/tg3.c | |
parent | 2445e461ce8c5a2316ed4c8a45cd2d0b6a366310 (diff) |
tg3: netdev_err() => dev_err()
Some uses of netdev_err() happen before the device has been registered.
This will cause the messages to be prepended with "(unregistered
net_device)" strings. We can clean up the message by using dev_err()
instead.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r-- | drivers/net/tg3.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 1247c4f98807..c7134c37936e 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -1098,7 +1098,7 @@ static int tg3_mdio_init(struct tg3 *tp) | |||
1098 | 1098 | ||
1099 | i = mdiobus_register(tp->mdio_bus); | 1099 | i = mdiobus_register(tp->mdio_bus); |
1100 | if (i) { | 1100 | if (i) { |
1101 | netdev_warn(tp->dev, "mdiobus_reg failed (0x%x)\n", i); | 1101 | dev_warn(&tp->pdev->dev, "mdiobus_reg failed (0x%x)\n", i); |
1102 | mdiobus_free(tp->mdio_bus); | 1102 | mdiobus_free(tp->mdio_bus); |
1103 | return i; | 1103 | return i; |
1104 | } | 1104 | } |
@@ -1106,7 +1106,7 @@ static int tg3_mdio_init(struct tg3 *tp) | |||
1106 | phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR]; | 1106 | phydev = tp->mdio_bus->phy_map[TG3_PHY_MII_ADDR]; |
1107 | 1107 | ||
1108 | if (!phydev || !phydev->drv) { | 1108 | if (!phydev || !phydev->drv) { |
1109 | netdev_warn(tp->dev, "No PHY devices\n"); | 1109 | dev_warn(&tp->pdev->dev, "No PHY devices\n"); |
1110 | mdiobus_unregister(tp->mdio_bus); | 1110 | mdiobus_unregister(tp->mdio_bus); |
1111 | mdiobus_free(tp->mdio_bus); | 1111 | mdiobus_free(tp->mdio_bus); |
1112 | return -ENODEV; | 1112 | return -ENODEV; |
@@ -1464,7 +1464,7 @@ static int tg3_phy_init(struct tg3 *tp) | |||
1464 | phydev = phy_connect(tp->dev, dev_name(&phydev->dev), tg3_adjust_link, | 1464 | phydev = phy_connect(tp->dev, dev_name(&phydev->dev), tg3_adjust_link, |
1465 | phydev->dev_flags, phydev->interface); | 1465 | phydev->dev_flags, phydev->interface); |
1466 | if (IS_ERR(phydev)) { | 1466 | if (IS_ERR(phydev)) { |
1467 | netdev_err(tp->dev, "Could not attach to PHY\n"); | 1467 | dev_err(&tp->pdev->dev, "Could not attach to PHY\n"); |
1468 | return PTR_ERR(phydev); | 1468 | return PTR_ERR(phydev); |
1469 | } | 1469 | } |
1470 | 1470 | ||
@@ -6481,8 +6481,9 @@ static int tg3_abort_hw(struct tg3 *tp, int silent) | |||
6481 | break; | 6481 | break; |
6482 | } | 6482 | } |
6483 | if (i >= MAX_WAIT_CNT) { | 6483 | if (i >= MAX_WAIT_CNT) { |
6484 | netdev_err(tp->dev, "%s timed out, TX_MODE_ENABLE will not clear MAC_TX_MODE=%08x\n", | 6484 | dev_err(&tp->pdev->dev, |
6485 | __func__, tr32(MAC_TX_MODE)); | 6485 | "%s timed out, TX_MODE_ENABLE will not clear " |
6486 | "MAC_TX_MODE=%08x\n", __func__, tr32(MAC_TX_MODE)); | ||
6486 | err |= -ENODEV; | 6487 | err |= -ENODEV; |
6487 | } | 6488 | } |
6488 | 6489 | ||
@@ -14514,7 +14515,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
14514 | 14515 | ||
14515 | tp->regs = pci_ioremap_bar(pdev, BAR_0); | 14516 | tp->regs = pci_ioremap_bar(pdev, BAR_0); |
14516 | if (!tp->regs) { | 14517 | if (!tp->regs) { |
14517 | netdev_err(dev, "Cannot map device registers, aborting\n"); | 14518 | dev_err(&pdev->dev, "Cannot map device registers, aborting\n"); |
14518 | err = -ENOMEM; | 14519 | err = -ENOMEM; |
14519 | goto err_out_free_dev; | 14520 | goto err_out_free_dev; |
14520 | } | 14521 | } |
@@ -14530,7 +14531,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
14530 | 14531 | ||
14531 | err = tg3_get_invariants(tp); | 14532 | err = tg3_get_invariants(tp); |
14532 | if (err) { | 14533 | if (err) { |
14533 | netdev_err(dev, "Problem fetching invariants of chip, aborting\n"); | 14534 | dev_err(&pdev->dev, |
14535 | "Problem fetching invariants of chip, aborting\n"); | ||
14534 | goto err_out_iounmap; | 14536 | goto err_out_iounmap; |
14535 | } | 14537 | } |
14536 | 14538 | ||
@@ -14565,7 +14567,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
14565 | err = pci_set_consistent_dma_mask(pdev, | 14567 | err = pci_set_consistent_dma_mask(pdev, |
14566 | persist_dma_mask); | 14568 | persist_dma_mask); |
14567 | if (err < 0) { | 14569 | if (err < 0) { |
14568 | netdev_err(dev, "Unable to obtain 64 bit DMA for consistent allocations\n"); | 14570 | dev_err(&pdev->dev, "Unable to obtain 64 bit " |
14571 | "DMA for consistent allocations\n"); | ||
14569 | goto err_out_iounmap; | 14572 | goto err_out_iounmap; |
14570 | } | 14573 | } |
14571 | } | 14574 | } |
@@ -14573,7 +14576,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
14573 | if (err || dma_mask == DMA_BIT_MASK(32)) { | 14576 | if (err || dma_mask == DMA_BIT_MASK(32)) { |
14574 | err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); | 14577 | err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); |
14575 | if (err) { | 14578 | if (err) { |
14576 | netdev_err(dev, "No usable DMA configuration, aborting\n"); | 14579 | dev_err(&pdev->dev, |
14580 | "No usable DMA configuration, aborting\n"); | ||
14577 | goto err_out_iounmap; | 14581 | goto err_out_iounmap; |
14578 | } | 14582 | } |
14579 | } | 14583 | } |
@@ -14622,14 +14626,16 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
14622 | 14626 | ||
14623 | err = tg3_get_device_address(tp); | 14627 | err = tg3_get_device_address(tp); |
14624 | if (err) { | 14628 | if (err) { |
14625 | netdev_err(dev, "Could not obtain valid ethernet address, aborting\n"); | 14629 | dev_err(&pdev->dev, |
14630 | "Could not obtain valid ethernet address, aborting\n"); | ||
14626 | goto err_out_iounmap; | 14631 | goto err_out_iounmap; |
14627 | } | 14632 | } |
14628 | 14633 | ||
14629 | if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) { | 14634 | if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) { |
14630 | tp->aperegs = pci_ioremap_bar(pdev, BAR_2); | 14635 | tp->aperegs = pci_ioremap_bar(pdev, BAR_2); |
14631 | if (!tp->aperegs) { | 14636 | if (!tp->aperegs) { |
14632 | netdev_err(dev, "Cannot map APE registers, aborting\n"); | 14637 | dev_err(&pdev->dev, |
14638 | "Cannot map APE registers, aborting\n"); | ||
14633 | err = -ENOMEM; | 14639 | err = -ENOMEM; |
14634 | goto err_out_iounmap; | 14640 | goto err_out_iounmap; |
14635 | } | 14641 | } |
@@ -14653,7 +14659,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
14653 | 14659 | ||
14654 | err = tg3_test_dma(tp); | 14660 | err = tg3_test_dma(tp); |
14655 | if (err) { | 14661 | if (err) { |
14656 | netdev_err(dev, "DMA engine test failed, aborting\n"); | 14662 | dev_err(&pdev->dev, "DMA engine test failed, aborting\n"); |
14657 | goto err_out_apeunmap; | 14663 | goto err_out_apeunmap; |
14658 | } | 14664 | } |
14659 | 14665 | ||
@@ -14714,7 +14720,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
14714 | 14720 | ||
14715 | err = register_netdev(dev); | 14721 | err = register_netdev(dev); |
14716 | if (err) { | 14722 | if (err) { |
14717 | netdev_err(dev, "Cannot register net device, aborting\n"); | 14723 | dev_err(&pdev->dev, "Cannot register net device, aborting\n"); |
14718 | goto err_out_apeunmap; | 14724 | goto err_out_apeunmap; |
14719 | } | 14725 | } |
14720 | 14726 | ||