Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31b7720c authored by Joe Perches's avatar Joe Perches Committed by David S. Miller
Browse files

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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bece1b97
Loading
Loading
Loading
Loading
+11 −15
Original line number Original line Diff line number Diff line
@@ -266,7 +266,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
		/* Ooops.  All transmit buffers are full.  Bail out.
		/* Ooops.  All transmit buffers are full.  Bail out.
		 * This should not happen, since ndev->tbusy should be set.
		 * This should not happen, since ndev->tbusy should be set.
		 */
		 */
		printk("%s: tx queue full!.\n", ndev->name);
		netdev_err(ndev, "tx queue full!\n");
		return NETDEV_TX_BUSY;
		return NETDEV_TX_BUSY;
	}
	}


@@ -578,7 +578,7 @@ fec_stop(struct net_device *ndev)
		writel(1, fep->hwp + FEC_X_CNTRL); /* Graceful transmit stop */
		writel(1, fep->hwp + FEC_X_CNTRL); /* Graceful transmit stop */
		udelay(10);
		udelay(10);
		if (!(readl(fep->hwp + FEC_IEVENT) & FEC_ENET_GRA))
		if (!(readl(fep->hwp + FEC_IEVENT) & FEC_ENET_GRA))
			printk("fec_stop : Graceful transmit stop did not complete !\n");
			netdev_err(ndev, "Graceful transmit stop did not complete!\n");
	}
	}


	/* Whack a reset.  We should wait for this. */
	/* Whack a reset.  We should wait for this. */
@@ -676,7 +676,7 @@ fec_enet_tx(struct net_device *ndev)
		}
		}


		if (status & BD_ENET_TX_READY)
		if (status & BD_ENET_TX_READY)
			printk("HEY! Enet xmit interrupt and TX_READY.\n");
			netdev_err(ndev, "HEY! Enet xmit interrupt and TX_READY\n");


		/* Deferred means some collisions occurred during transmit,
		/* Deferred means some collisions occurred during transmit,
		 * but we eventually sent the packet OK.
		 * but we eventually sent the packet OK.
@@ -744,7 +744,7 @@ fec_enet_rx(struct net_device *ndev, int budget)
		 * the last indicator should be set.
		 * the last indicator should be set.
		 */
		 */
		if ((status & BD_ENET_RX_LAST) == 0)
		if ((status & BD_ENET_RX_LAST) == 0)
			printk("FEC ENET: rcv is not +last\n");
			netdev_err(ndev, "rcv is not +last\n");


		if (!fep->opened)
		if (!fep->opened)
			goto rx_processing_done;
			goto rx_processing_done;
@@ -1031,7 +1031,7 @@ static int fec_enet_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
			usecs_to_jiffies(FEC_MII_TIMEOUT));
			usecs_to_jiffies(FEC_MII_TIMEOUT));
	if (time_left == 0) {
	if (time_left == 0) {
		fep->mii_timeout = 1;
		fep->mii_timeout = 1;
		printk(KERN_ERR "FEC: MDIO read timeout\n");
		netdev_err(fep->netdev, "MDIO read timeout\n");
		return -ETIMEDOUT;
		return -ETIMEDOUT;
	}
	}


@@ -1059,7 +1059,7 @@ static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
			usecs_to_jiffies(FEC_MII_TIMEOUT));
			usecs_to_jiffies(FEC_MII_TIMEOUT));
	if (time_left == 0) {
	if (time_left == 0) {
		fep->mii_timeout = 1;
		fep->mii_timeout = 1;
		printk(KERN_ERR "FEC: MDIO write timeout\n");
		netdev_err(fep->netdev, "MDIO write timeout\n");
		return -ETIMEDOUT;
		return -ETIMEDOUT;
	}
	}


@@ -1099,9 +1099,7 @@ static int fec_enet_mii_probe(struct net_device *ndev)
	}
	}


	if (phy_id >= PHY_MAX_ADDR) {
	if (phy_id >= PHY_MAX_ADDR) {
		printk(KERN_INFO
		netdev_info(ndev, "no PHY, assuming direct connection to switch\n");
			"%s: no PHY, assuming direct connection to switch\n",
			ndev->name);
		strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE);
		strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE);
		phy_id = 0;
		phy_id = 0;
	}
	}
@@ -1110,7 +1108,7 @@ static int fec_enet_mii_probe(struct net_device *ndev)
	phy_dev = phy_connect(ndev, phy_name, &fec_enet_adjust_link,
	phy_dev = phy_connect(ndev, phy_name, &fec_enet_adjust_link,
			      fep->phy_interface);
			      fep->phy_interface);
	if (IS_ERR(phy_dev)) {
	if (IS_ERR(phy_dev)) {
		printk(KERN_ERR "%s: could not attach to PHY\n", ndev->name);
		netdev_err(ndev, "could not attach to PHY\n");
		return PTR_ERR(phy_dev);
		return PTR_ERR(phy_dev);
	}
	}


@@ -1128,9 +1126,7 @@ static int fec_enet_mii_probe(struct net_device *ndev)
	fep->link = 0;
	fep->link = 0;
	fep->full_duplex = 0;
	fep->full_duplex = 0;


	printk(KERN_INFO
	netdev_info(ndev, "Freescale FEC PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n",
		"%s: Freescale FEC PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n",
		ndev->name,
		    fep->phy_dev->drv->name, dev_name(&fep->phy_dev->dev),
		    fep->phy_dev->drv->name, dev_name(&fep->phy_dev->dev),
		    fep->phy_dev->irq);
		    fep->phy_dev->irq);


+8 −8
Original line number Original line Diff line number Diff line
@@ -14,6 +14,8 @@
 *
 *
 */
 */


#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/dma-mapping.h>
#include <linux/dma-mapping.h>
#include <linux/module.h>
#include <linux/module.h>


@@ -858,13 +860,11 @@ static int mpc52xx_fec_probe(struct platform_device *op)
	/* Reserve FEC control zone */
	/* Reserve FEC control zone */
	rv = of_address_to_resource(np, 0, &mem);
	rv = of_address_to_resource(np, 0, &mem);
	if (rv) {
	if (rv) {
		printk(KERN_ERR DRIVER_NAME ": "
		pr_err("Error while parsing device node resource\n");
				"Error while parsing device node resource\n" );
		goto err_netdev;
		goto err_netdev;
	}
	}
	if (resource_size(&mem) < sizeof(struct mpc52xx_fec)) {
	if (resource_size(&mem) < sizeof(struct mpc52xx_fec)) {
		printk(KERN_ERR DRIVER_NAME
		pr_err("invalid resource size (%lx < %x), check mpc52xx_devices.c\n",
		       " - invalid resource size (%lx < %x), check mpc52xx_devices.c\n",
		       (unsigned long)resource_size(&mem),
		       (unsigned long)resource_size(&mem),
		       sizeof(struct mpc52xx_fec));
		       sizeof(struct mpc52xx_fec));
		rv = -EINVAL;
		rv = -EINVAL;
@@ -902,7 +902,7 @@ static int mpc52xx_fec_probe(struct platform_device *op)
	priv->tx_dmatsk = bcom_fec_tx_init(FEC_TX_NUM_BD, tx_fifo);
	priv->tx_dmatsk = bcom_fec_tx_init(FEC_TX_NUM_BD, tx_fifo);


	if (!priv->rx_dmatsk || !priv->tx_dmatsk) {
	if (!priv->rx_dmatsk || !priv->tx_dmatsk) {
		printk(KERN_ERR DRIVER_NAME ": Can not init SDMA tasks\n" );
		pr_err("Can not init SDMA tasks\n");
		rv = -ENOMEM;
		rv = -ENOMEM;
		goto err_rx_tx_dmatsk;
		goto err_rx_tx_dmatsk;
	}
	}
@@ -982,8 +982,8 @@ static int mpc52xx_fec_probe(struct platform_device *op)


	/* We're done ! */
	/* We're done ! */
	dev_set_drvdata(&op->dev, ndev);
	dev_set_drvdata(&op->dev, ndev);
	printk(KERN_INFO "%s: %s MAC %pM\n",
	netdev_info(ndev, "%s MAC %pM\n",
	       ndev->name, op->dev.of_node->full_name, ndev->dev_addr);
		    op->dev.of_node->full_name, ndev->dev_addr);


	return 0;
	return 0;


@@ -1094,7 +1094,7 @@ mpc52xx_fec_init(void)
	int ret;
	int ret;
	ret = platform_driver_register(&mpc52xx_fec_mdio_driver);
	ret = platform_driver_register(&mpc52xx_fec_mdio_driver);
	if (ret) {
	if (ret) {
		printk(KERN_ERR DRIVER_NAME ": failed to register mdio driver\n");
		pr_err("failed to register mdio driver\n");
		return ret;
		return ret;
	}
	}
#endif
#endif
+2 −0
Original line number Original line Diff line number Diff line
@@ -17,6 +17,8 @@
 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 */
 */


#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/string.h>