diff options
author | Joe Perches <joe@perches.com> | 2013-04-13 15:03:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-04-14 15:41:49 -0400 |
commit | 31b7720c825934bca1c0f9f562b0c2dc25f7ae81 (patch) | |
tree | a65e5bec9cac783878e6b24c841ab3f172de09da | |
parent | bece1b9708434b6fb90b029affc228fc21688404 (diff) |
fec: Convert printks to netdev_<level>
Use a more current logging message style.
Convert the printks where a struct net_device is available to
netdev_<level>. Convert the other printks to pr_<level> and
add pr_fmt where appropriate.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 26 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/fec_mpc52xx.c | 16 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/fec_ptp.c | 2 |
3 files changed, 21 insertions, 23 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 153437b32358..d7657a46a9eb 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -266,7 +266,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
266 | /* Ooops. All transmit buffers are full. Bail out. | 266 | /* Ooops. All transmit buffers are full. Bail out. |
267 | * This should not happen, since ndev->tbusy should be set. | 267 | * This should not happen, since ndev->tbusy should be set. |
268 | */ | 268 | */ |
269 | printk("%s: tx queue full!.\n", ndev->name); | 269 | netdev_err(ndev, "tx queue full!\n"); |
270 | return NETDEV_TX_BUSY; | 270 | return NETDEV_TX_BUSY; |
271 | } | 271 | } |
272 | 272 | ||
@@ -578,7 +578,7 @@ fec_stop(struct net_device *ndev) | |||
578 | writel(1, fep->hwp + FEC_X_CNTRL); /* Graceful transmit stop */ | 578 | writel(1, fep->hwp + FEC_X_CNTRL); /* Graceful transmit stop */ |
579 | udelay(10); | 579 | udelay(10); |
580 | if (!(readl(fep->hwp + FEC_IEVENT) & FEC_ENET_GRA)) | 580 | if (!(readl(fep->hwp + FEC_IEVENT) & FEC_ENET_GRA)) |
581 | printk("fec_stop : Graceful transmit stop did not complete !\n"); | 581 | netdev_err(ndev, "Graceful transmit stop did not complete!\n"); |
582 | } | 582 | } |
583 | 583 | ||
584 | /* Whack a reset. We should wait for this. */ | 584 | /* Whack a reset. We should wait for this. */ |
@@ -676,7 +676,7 @@ fec_enet_tx(struct net_device *ndev) | |||
676 | } | 676 | } |
677 | 677 | ||
678 | if (status & BD_ENET_TX_READY) | 678 | if (status & BD_ENET_TX_READY) |
679 | printk("HEY! Enet xmit interrupt and TX_READY.\n"); | 679 | netdev_err(ndev, "HEY! Enet xmit interrupt and TX_READY\n"); |
680 | 680 | ||
681 | /* Deferred means some collisions occurred during transmit, | 681 | /* Deferred means some collisions occurred during transmit, |
682 | * but we eventually sent the packet OK. | 682 | * but we eventually sent the packet OK. |
@@ -744,7 +744,7 @@ fec_enet_rx(struct net_device *ndev, int budget) | |||
744 | * the last indicator should be set. | 744 | * the last indicator should be set. |
745 | */ | 745 | */ |
746 | if ((status & BD_ENET_RX_LAST) == 0) | 746 | if ((status & BD_ENET_RX_LAST) == 0) |
747 | printk("FEC ENET: rcv is not +last\n"); | 747 | netdev_err(ndev, "rcv is not +last\n"); |
748 | 748 | ||
749 | if (!fep->opened) | 749 | if (!fep->opened) |
750 | goto rx_processing_done; | 750 | goto rx_processing_done; |
@@ -1031,7 +1031,7 @@ static int fec_enet_mdio_read(struct mii_bus *bus, int mii_id, int regnum) | |||
1031 | usecs_to_jiffies(FEC_MII_TIMEOUT)); | 1031 | usecs_to_jiffies(FEC_MII_TIMEOUT)); |
1032 | if (time_left == 0) { | 1032 | if (time_left == 0) { |
1033 | fep->mii_timeout = 1; | 1033 | fep->mii_timeout = 1; |
1034 | printk(KERN_ERR "FEC: MDIO read timeout\n"); | 1034 | netdev_err(fep->netdev, "MDIO read timeout\n"); |
1035 | return -ETIMEDOUT; | 1035 | return -ETIMEDOUT; |
1036 | } | 1036 | } |
1037 | 1037 | ||
@@ -1059,7 +1059,7 @@ static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum, | |||
1059 | usecs_to_jiffies(FEC_MII_TIMEOUT)); | 1059 | usecs_to_jiffies(FEC_MII_TIMEOUT)); |
1060 | if (time_left == 0) { | 1060 | if (time_left == 0) { |
1061 | fep->mii_timeout = 1; | 1061 | fep->mii_timeout = 1; |
1062 | printk(KERN_ERR "FEC: MDIO write timeout\n"); | 1062 | netdev_err(fep->netdev, "MDIO write timeout\n"); |
1063 | return -ETIMEDOUT; | 1063 | return -ETIMEDOUT; |
1064 | } | 1064 | } |
1065 | 1065 | ||
@@ -1099,9 +1099,7 @@ static int fec_enet_mii_probe(struct net_device *ndev) | |||
1099 | } | 1099 | } |
1100 | 1100 | ||
1101 | if (phy_id >= PHY_MAX_ADDR) { | 1101 | if (phy_id >= PHY_MAX_ADDR) { |
1102 | printk(KERN_INFO | 1102 | netdev_info(ndev, "no PHY, assuming direct connection to switch\n"); |
1103 | "%s: no PHY, assuming direct connection to switch\n", | ||
1104 | ndev->name); | ||
1105 | strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); | 1103 | strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); |
1106 | phy_id = 0; | 1104 | phy_id = 0; |
1107 | } | 1105 | } |
@@ -1110,7 +1108,7 @@ static int fec_enet_mii_probe(struct net_device *ndev) | |||
1110 | phy_dev = phy_connect(ndev, phy_name, &fec_enet_adjust_link, | 1108 | phy_dev = phy_connect(ndev, phy_name, &fec_enet_adjust_link, |
1111 | fep->phy_interface); | 1109 | fep->phy_interface); |
1112 | if (IS_ERR(phy_dev)) { | 1110 | if (IS_ERR(phy_dev)) { |
1113 | printk(KERN_ERR "%s: could not attach to PHY\n", ndev->name); | 1111 | netdev_err(ndev, "could not attach to PHY\n"); |
1114 | return PTR_ERR(phy_dev); | 1112 | return PTR_ERR(phy_dev); |
1115 | } | 1113 | } |
1116 | 1114 | ||
@@ -1128,11 +1126,9 @@ static int fec_enet_mii_probe(struct net_device *ndev) | |||
1128 | fep->link = 0; | 1126 | fep->link = 0; |
1129 | fep->full_duplex = 0; | 1127 | fep->full_duplex = 0; |
1130 | 1128 | ||
1131 | printk(KERN_INFO | 1129 | netdev_info(ndev, "Freescale FEC PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n", |
1132 | "%s: Freescale FEC PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n", | 1130 | fep->phy_dev->drv->name, dev_name(&fep->phy_dev->dev), |
1133 | ndev->name, | 1131 | fep->phy_dev->irq); |
1134 | fep->phy_dev->drv->name, dev_name(&fep->phy_dev->dev), | ||
1135 | fep->phy_dev->irq); | ||
1136 | 1132 | ||
1137 | return 0; | 1133 | return 0; |
1138 | } | 1134 | } |
diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx.c b/drivers/net/ethernet/freescale/fec_mpc52xx.c index 77943a6a1b8c..9bc15e2365bb 100644 --- a/drivers/net/ethernet/freescale/fec_mpc52xx.c +++ b/drivers/net/ethernet/freescale/fec_mpc52xx.c | |||
@@ -14,6 +14,8 @@ | |||
14 | * | 14 | * |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
18 | |||
17 | #include <linux/dma-mapping.h> | 19 | #include <linux/dma-mapping.h> |
18 | #include <linux/module.h> | 20 | #include <linux/module.h> |
19 | 21 | ||
@@ -858,13 +860,11 @@ static int mpc52xx_fec_probe(struct platform_device *op) | |||
858 | /* Reserve FEC control zone */ | 860 | /* Reserve FEC control zone */ |
859 | rv = of_address_to_resource(np, 0, &mem); | 861 | rv = of_address_to_resource(np, 0, &mem); |
860 | if (rv) { | 862 | if (rv) { |
861 | printk(KERN_ERR DRIVER_NAME ": " | 863 | pr_err("Error while parsing device node resource\n"); |
862 | "Error while parsing device node resource\n" ); | ||
863 | goto err_netdev; | 864 | goto err_netdev; |
864 | } | 865 | } |
865 | if (resource_size(&mem) < sizeof(struct mpc52xx_fec)) { | 866 | if (resource_size(&mem) < sizeof(struct mpc52xx_fec)) { |
866 | printk(KERN_ERR DRIVER_NAME | 867 | pr_err("invalid resource size (%lx < %x), check mpc52xx_devices.c\n", |
867 | " - invalid resource size (%lx < %x), check mpc52xx_devices.c\n", | ||
868 | (unsigned long)resource_size(&mem), | 868 | (unsigned long)resource_size(&mem), |
869 | sizeof(struct mpc52xx_fec)); | 869 | sizeof(struct mpc52xx_fec)); |
870 | rv = -EINVAL; | 870 | rv = -EINVAL; |
@@ -902,7 +902,7 @@ static int mpc52xx_fec_probe(struct platform_device *op) | |||
902 | priv->tx_dmatsk = bcom_fec_tx_init(FEC_TX_NUM_BD, tx_fifo); | 902 | priv->tx_dmatsk = bcom_fec_tx_init(FEC_TX_NUM_BD, tx_fifo); |
903 | 903 | ||
904 | if (!priv->rx_dmatsk || !priv->tx_dmatsk) { | 904 | if (!priv->rx_dmatsk || !priv->tx_dmatsk) { |
905 | printk(KERN_ERR DRIVER_NAME ": Can not init SDMA tasks\n" ); | 905 | pr_err("Can not init SDMA tasks\n"); |
906 | rv = -ENOMEM; | 906 | rv = -ENOMEM; |
907 | goto err_rx_tx_dmatsk; | 907 | goto err_rx_tx_dmatsk; |
908 | } | 908 | } |
@@ -982,8 +982,8 @@ static int mpc52xx_fec_probe(struct platform_device *op) | |||
982 | 982 | ||
983 | /* We're done ! */ | 983 | /* We're done ! */ |
984 | dev_set_drvdata(&op->dev, ndev); | 984 | dev_set_drvdata(&op->dev, ndev); |
985 | printk(KERN_INFO "%s: %s MAC %pM\n", | 985 | netdev_info(ndev, "%s MAC %pM\n", |
986 | ndev->name, op->dev.of_node->full_name, ndev->dev_addr); | 986 | op->dev.of_node->full_name, ndev->dev_addr); |
987 | 987 | ||
988 | return 0; | 988 | return 0; |
989 | 989 | ||
@@ -1094,7 +1094,7 @@ mpc52xx_fec_init(void) | |||
1094 | int ret; | 1094 | int ret; |
1095 | ret = platform_driver_register(&mpc52xx_fec_mdio_driver); | 1095 | ret = platform_driver_register(&mpc52xx_fec_mdio_driver); |
1096 | if (ret) { | 1096 | if (ret) { |
1097 | printk(KERN_ERR DRIVER_NAME ": failed to register mdio driver\n"); | 1097 | pr_err("failed to register mdio driver\n"); |
1098 | return ret; | 1098 | return ret; |
1099 | } | 1099 | } |
1100 | #endif | 1100 | #endif |
diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c index e040c8b2733a..25fc960cbf0e 100644 --- a/drivers/net/ethernet/freescale/fec_ptp.c +++ b/drivers/net/ethernet/freescale/fec_ptp.c | |||
@@ -17,6 +17,8 @@ | |||
17 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | 17 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
21 | |||
20 | #include <linux/module.h> | 22 | #include <linux/module.h> |
21 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
22 | #include <linux/string.h> | 24 | #include <linux/string.h> |