aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2010-04-05 06:19:21 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-06 06:57:59 -0400
commit2445e461ce8c5a2316ed4c8a45cd2d0b6a366310 (patch)
tree7072b0bd3b7a21a209583799b87f99715f968d56 /drivers
parent6d40db7beaef823621ff3d340ef53d08445960b4 (diff)
tg3: Replace pr_err with sensible alternatives
All the instances of pr_err() in the tg3 driver have better alternatives. This patch replaces all pr_err() calls. 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')
-rw-r--r--drivers/net/tg3.c46
1 files changed, 26 insertions, 20 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 4c71f3efe07b..1247c4f98807 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -6433,8 +6433,9 @@ static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, u32 enable_bit, int
6433 } 6433 }
6434 6434
6435 if (i == MAX_WAIT_CNT && !silent) { 6435 if (i == MAX_WAIT_CNT && !silent) {
6436 pr_err("tg3_stop_block timed out, ofs=%lx enable_bit=%x\n", 6436 dev_err(&tp->pdev->dev,
6437 ofs, enable_bit); 6437 "tg3_stop_block timed out, ofs=%lx enable_bit=%x\n",
6438 ofs, enable_bit);
6438 return -ENODEV; 6439 return -ENODEV;
6439 } 6440 }
6440 6441
@@ -10648,7 +10649,8 @@ static int tg3_test_registers(struct tg3 *tp)
10648 10649
10649out: 10650out:
10650 if (netif_msg_hw(tp)) 10651 if (netif_msg_hw(tp))
10651 pr_err("Register test failed at offset %x\n", offset); 10652 netdev_err(tp->dev,
10653 "Register test failed at offset %x\n", offset);
10652 tw32(offset, save_val); 10654 tw32(offset, save_val);
10653 return -EIO; 10655 return -EIO;
10654} 10656}
@@ -13223,7 +13225,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
13223 (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) { 13225 (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) {
13224 tp->pcix_cap = pci_find_capability(tp->pdev, PCI_CAP_ID_PCIX); 13226 tp->pcix_cap = pci_find_capability(tp->pdev, PCI_CAP_ID_PCIX);
13225 if (!tp->pcix_cap) { 13227 if (!tp->pcix_cap) {
13226 pr_err("Cannot find PCI-X capability, aborting\n"); 13228 dev_err(&tp->pdev->dev,
13229 "Cannot find PCI-X capability, aborting\n");
13227 return -EIO; 13230 return -EIO;
13228 } 13231 }
13229 13232
@@ -13420,7 +13423,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
13420 /* Force the chip into D0. */ 13423 /* Force the chip into D0. */
13421 err = tg3_set_power_state(tp, PCI_D0); 13424 err = tg3_set_power_state(tp, PCI_D0);
13422 if (err) { 13425 if (err) {
13423 pr_err("(%s) transition to D0 failed\n", pci_name(tp->pdev)); 13426 dev_err(&tp->pdev->dev, "Transition to D0 failed\n");
13424 return err; 13427 return err;
13425 } 13428 }
13426 13429
@@ -13594,8 +13597,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
13594 13597
13595 err = tg3_phy_probe(tp); 13598 err = tg3_phy_probe(tp);
13596 if (err) { 13599 if (err) {
13597 pr_err("(%s) phy probe failed, err %d\n", 13600 dev_err(&tp->pdev->dev, "phy probe failed, err %d\n", err);
13598 pci_name(tp->pdev), err);
13599 /* ... but do not return immediately ... */ 13601 /* ... but do not return immediately ... */
13600 tg3_mdio_fini(tp); 13602 tg3_mdio_fini(tp);
13601 } 13603 }
@@ -14104,8 +14106,9 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
14104 /* Send the buffer to the chip. */ 14106 /* Send the buffer to the chip. */
14105 ret = tg3_do_test_dma(tp, buf, buf_dma, TEST_BUFFER_SIZE, 1); 14107 ret = tg3_do_test_dma(tp, buf, buf_dma, TEST_BUFFER_SIZE, 1);
14106 if (ret) { 14108 if (ret) {
14107 pr_err("tg3_test_dma() Write the buffer failed %d\n", 14109 dev_err(&tp->pdev->dev,
14108 ret); 14110 "%s: Buffer write failed. err = %d\n",
14111 __func__, ret);
14109 break; 14112 break;
14110 } 14113 }
14111 14114
@@ -14115,8 +14118,9 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
14115 u32 val; 14118 u32 val;
14116 tg3_read_mem(tp, 0x2100 + (i*4), &val); 14119 tg3_read_mem(tp, 0x2100 + (i*4), &val);
14117 if (le32_to_cpu(val) != p[i]) { 14120 if (le32_to_cpu(val) != p[i]) {
14118 pr_err(" tg3_test_dma() Card buffer corrupted on write! (%d != %d)\n", 14121 dev_err(&tp->pdev->dev,
14119 val, i); 14122 "%s: Buffer corrupted on device! "
14123 "(%d != %d)\n", __func__, val, i);
14120 /* ret = -ENODEV here? */ 14124 /* ret = -ENODEV here? */
14121 } 14125 }
14122 p[i] = 0; 14126 p[i] = 0;
@@ -14125,9 +14129,9 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
14125 /* Now read it back. */ 14129 /* Now read it back. */
14126 ret = tg3_do_test_dma(tp, buf, buf_dma, TEST_BUFFER_SIZE, 0); 14130 ret = tg3_do_test_dma(tp, buf, buf_dma, TEST_BUFFER_SIZE, 0);
14127 if (ret) { 14131 if (ret) {
14128 pr_err("tg3_test_dma() Read the buffer failed %d\n", 14132 dev_err(&tp->pdev->dev,
14129 ret); 14133 "%s: Buffer read failed. err = %d\n",
14130 14134 __func__, ret);
14131 break; 14135 break;
14132 } 14136 }
14133 14137
@@ -14143,8 +14147,9 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
14143 tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl); 14147 tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl);
14144 break; 14148 break;
14145 } else { 14149 } else {
14146 pr_err("tg3_test_dma() buffer corrupted on read back! (%d != %d)\n", 14150 dev_err(&tp->pdev->dev,
14147 p[i], i); 14151 "%s: Buffer corrupted on read back! "
14152 "(%d != %d)\n", __func__, p[i], i);
14148 ret = -ENODEV; 14153 ret = -ENODEV;
14149 goto out; 14154 goto out;
14150 } 14155 }
@@ -14436,13 +14441,13 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
14436 14441
14437 err = pci_enable_device(pdev); 14442 err = pci_enable_device(pdev);
14438 if (err) { 14443 if (err) {
14439 pr_err("Cannot enable PCI device, aborting\n"); 14444 dev_err(&pdev->dev, "Cannot enable PCI device, aborting\n");
14440 return err; 14445 return err;
14441 } 14446 }
14442 14447
14443 err = pci_request_regions(pdev, DRV_MODULE_NAME); 14448 err = pci_request_regions(pdev, DRV_MODULE_NAME);
14444 if (err) { 14449 if (err) {
14445 pr_err("Cannot obtain PCI resources, aborting\n"); 14450 dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting\n");
14446 goto err_out_disable_pdev; 14451 goto err_out_disable_pdev;
14447 } 14452 }
14448 14453
@@ -14451,14 +14456,15 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
14451 /* Find power-management capability. */ 14456 /* Find power-management capability. */
14452 pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM); 14457 pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
14453 if (pm_cap == 0) { 14458 if (pm_cap == 0) {
14454 pr_err("Cannot find PowerManagement capability, aborting\n"); 14459 dev_err(&pdev->dev,
14460 "Cannot find Power Management capability, aborting\n");
14455 err = -EIO; 14461 err = -EIO;
14456 goto err_out_free_res; 14462 goto err_out_free_res;
14457 } 14463 }
14458 14464
14459 dev = alloc_etherdev_mq(sizeof(*tp), TG3_IRQ_MAX_VECS); 14465 dev = alloc_etherdev_mq(sizeof(*tp), TG3_IRQ_MAX_VECS);
14460 if (!dev) { 14466 if (!dev) {
14461 pr_err("Etherdev alloc failed, aborting\n"); 14467 dev_err(&pdev->dev, "Etherdev alloc failed, aborting\n");
14462 err = -ENOMEM; 14468 err = -ENOMEM;
14463 goto err_out_free_res; 14469 goto err_out_free_res;
14464 } 14470 }