Commit 09a1732b authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

dscc4: Update to current logging forms

Use pr_fmt, pr_<level> and netdev_<level> as appropriate.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 86fb0ccf
...@@ -80,6 +80,8 @@ ...@@ -80,6 +80,8 @@
* - misc crapectomy. * - misc crapectomy.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/types.h> #include <linux/types.h>
...@@ -553,7 +555,7 @@ static int dscc4_wait_ack_cec(struct dscc4_dev_priv *dpriv, ...@@ -553,7 +555,7 @@ static int dscc4_wait_ack_cec(struct dscc4_dev_priv *dpriv,
schedule_timeout_uninterruptible(10); schedule_timeout_uninterruptible(10);
rmb(); rmb();
} while (++i > 0); } while (++i > 0);
printk(KERN_ERR "%s: %s timeout\n", dev->name, msg); netdev_err(dev, "%s timeout\n", msg);
done: done:
return (i >= 0) ? i : -EAGAIN; return (i >= 0) ? i : -EAGAIN;
} }
...@@ -569,18 +571,18 @@ static int dscc4_do_action(struct net_device *dev, char *msg) ...@@ -569,18 +571,18 @@ static int dscc4_do_action(struct net_device *dev, char *msg)
u32 state = readl(ioaddr); u32 state = readl(ioaddr);
if (state & ArAck) { if (state & ArAck) {
printk(KERN_DEBUG "%s: %s ack\n", dev->name, msg); netdev_dbg(dev, "%s ack\n", msg);
writel(ArAck, ioaddr); writel(ArAck, ioaddr);
goto done; goto done;
} else if (state & Arf) { } else if (state & Arf) {
printk(KERN_ERR "%s: %s failed\n", dev->name, msg); netdev_err(dev, "%s failed\n", msg);
writel(Arf, ioaddr); writel(Arf, ioaddr);
i = -1; i = -1;
goto done; goto done;
} }
rmb(); rmb();
} while (++i > 0); } while (++i > 0);
printk(KERN_ERR "%s: %s timeout\n", dev->name, msg); netdev_err(dev, "%s timeout\n", msg);
done: done:
return i; return i;
} }
...@@ -636,7 +638,7 @@ static void dscc4_tx_reset(struct dscc4_dev_priv *dpriv, struct net_device *dev) ...@@ -636,7 +638,7 @@ static void dscc4_tx_reset(struct dscc4_dev_priv *dpriv, struct net_device *dev)
writel(MTFi|Rdt, dpriv->base_addr + dpriv->dev_id*0x0c + CH0CFG); writel(MTFi|Rdt, dpriv->base_addr + dpriv->dev_id*0x0c + CH0CFG);
if (dscc4_do_action(dev, "Rdt") < 0) if (dscc4_do_action(dev, "Rdt") < 0)
printk(KERN_ERR "%s: Tx reset failed\n", dev->name); netdev_err(dev, "Tx reset failed\n");
} }
#endif #endif
...@@ -722,22 +724,20 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev, ...@@ -722,22 +724,20 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev,
rc = pci_request_region(pdev, 0, "registers"); rc = pci_request_region(pdev, 0, "registers");
if (rc < 0) { if (rc < 0) {
printk(KERN_ERR "%s: can't reserve MMIO region (regs)\n", pr_err("can't reserve MMIO region (regs)\n");
DRV_NAME);
goto err_disable_0; goto err_disable_0;
} }
rc = pci_request_region(pdev, 1, "LBI interface"); rc = pci_request_region(pdev, 1, "LBI interface");
if (rc < 0) { if (rc < 0) {
printk(KERN_ERR "%s: can't reserve MMIO region (lbi)\n", pr_err("can't reserve MMIO region (lbi)\n");
DRV_NAME);
goto err_free_mmio_region_1; goto err_free_mmio_region_1;
} }
ioaddr = pci_ioremap_bar(pdev, 0); ioaddr = pci_ioremap_bar(pdev, 0);
if (!ioaddr) { if (!ioaddr) {
printk(KERN_ERR "%s: cannot remap MMIO region %llx @ %llx\n", pr_err("cannot remap MMIO region %llx @ %llx\n",
DRV_NAME, (unsigned long long)pci_resource_len(pdev, 0), (unsigned long long)pci_resource_len(pdev, 0),
(unsigned long long)pci_resource_start(pdev, 0)); (unsigned long long)pci_resource_start(pdev, 0));
rc = -EIO; rc = -EIO;
goto err_free_mmio_regions_2; goto err_free_mmio_regions_2;
} }
...@@ -757,7 +757,7 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev, ...@@ -757,7 +757,7 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev,
rc = request_irq(pdev->irq, dscc4_irq, IRQF_SHARED, DRV_NAME, priv->root); rc = request_irq(pdev->irq, dscc4_irq, IRQF_SHARED, DRV_NAME, priv->root);
if (rc < 0) { if (rc < 0) {
printk(KERN_WARNING "%s: IRQ %d busy\n", DRV_NAME, pdev->irq); pr_warn("IRQ %d busy\n", pdev->irq);
goto err_release_4; goto err_release_4;
} }
...@@ -904,7 +904,7 @@ static int dscc4_found1(struct pci_dev *pdev, void __iomem *ioaddr) ...@@ -904,7 +904,7 @@ static int dscc4_found1(struct pci_dev *pdev, void __iomem *ioaddr)
root = kcalloc(dev_per_card, sizeof(*root), GFP_KERNEL); root = kcalloc(dev_per_card, sizeof(*root), GFP_KERNEL);
if (!root) { if (!root) {
printk(KERN_ERR "%s: can't allocate data\n", DRV_NAME); pr_err("can't allocate data\n");
goto err_out; goto err_out;
} }
...@@ -916,7 +916,7 @@ static int dscc4_found1(struct pci_dev *pdev, void __iomem *ioaddr) ...@@ -916,7 +916,7 @@ static int dscc4_found1(struct pci_dev *pdev, void __iomem *ioaddr)
ppriv = kzalloc(sizeof(*ppriv), GFP_KERNEL); ppriv = kzalloc(sizeof(*ppriv), GFP_KERNEL);
if (!ppriv) { if (!ppriv) {
printk(KERN_ERR "%s: can't allocate private data\n", DRV_NAME); pr_err("can't allocate private data\n");
goto err_free_dev; goto err_free_dev;
} }
...@@ -952,7 +952,7 @@ static int dscc4_found1(struct pci_dev *pdev, void __iomem *ioaddr) ...@@ -952,7 +952,7 @@ static int dscc4_found1(struct pci_dev *pdev, void __iomem *ioaddr)
ret = register_hdlc_device(d); ret = register_hdlc_device(d);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "%s: unable to register\n", DRV_NAME); pr_err("unable to register\n");
dscc4_release_ring(dpriv); dscc4_release_ring(dpriv);
goto err_unregister; goto err_unregister;
} }
...@@ -1005,7 +1005,7 @@ static int dscc4_loopback_check(struct dscc4_dev_priv *dpriv) ...@@ -1005,7 +1005,7 @@ static int dscc4_loopback_check(struct dscc4_dev_priv *dpriv)
if (settings->loopback && (settings->clock_type != CLOCK_INT)) { if (settings->loopback && (settings->clock_type != CLOCK_INT)) {
struct net_device *dev = dscc4_to_dev(dpriv); struct net_device *dev = dscc4_to_dev(dpriv);
printk(KERN_INFO "%s: loopback requires clock\n", dev->name); netdev_info(dev, "loopback requires clock\n");
return -1; return -1;
} }
return 0; return 0;
...@@ -1078,7 +1078,7 @@ static int dscc4_open(struct net_device *dev) ...@@ -1078,7 +1078,7 @@ static int dscc4_open(struct net_device *dev)
scc_patchl(0, PowerUp, dpriv, dev, CCR0); scc_patchl(0, PowerUp, dpriv, dev, CCR0);
scc_patchl(0, 0x00050000, dpriv, dev, CCR2); scc_patchl(0, 0x00050000, dpriv, dev, CCR2);
scc_writel(EventsMask, dpriv, dev, IMR); scc_writel(EventsMask, dpriv, dev, IMR);
printk(KERN_INFO "%s: up again.\n", dev->name); netdev_info(dev, "up again\n");
goto done; goto done;
} }
...@@ -1095,11 +1095,11 @@ static int dscc4_open(struct net_device *dev) ...@@ -1095,11 +1095,11 @@ static int dscc4_open(struct net_device *dev)
* situations. * situations.
*/ */
if (scc_readl_star(dpriv, dev) & SccBusy) { if (scc_readl_star(dpriv, dev) & SccBusy) {
printk(KERN_ERR "%s busy. Try later\n", dev->name); netdev_err(dev, "busy - try later\n");
ret = -EAGAIN; ret = -EAGAIN;
goto err_out; goto err_out;
} else } else
printk(KERN_INFO "%s: available. Good\n", dev->name); netdev_info(dev, "available - good\n");
scc_writel(EventsMask, dpriv, dev, IMR); scc_writel(EventsMask, dpriv, dev, IMR);
...@@ -1117,7 +1117,7 @@ static int dscc4_open(struct net_device *dev) ...@@ -1117,7 +1117,7 @@ static int dscc4_open(struct net_device *dev)
* reset is needed. Suggestions anyone ? * reset is needed. Suggestions anyone ?
*/ */
if ((ret = dscc4_xpr_ack(dpriv)) < 0) { if ((ret = dscc4_xpr_ack(dpriv)) < 0) {
printk(KERN_ERR "%s: %s timeout\n", DRV_NAME, "XPR"); pr_err("XPR timeout\n");
goto err_disable_scc_events; goto err_disable_scc_events;
} }
...@@ -1342,8 +1342,7 @@ static int dscc4_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -1342,8 +1342,7 @@ static int dscc4_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
return -EPERM; return -EPERM;
if (dpriv->flags & FakeReset) { if (dpriv->flags & FakeReset) {
printk(KERN_INFO "%s: please reset the device" netdev_info(dev, "please reset the device before this command\n");
" before this command\n", dev->name);
return -EPERM; return -EPERM;
} }
if (copy_from_user(&dpriv->settings, line, size)) if (copy_from_user(&dpriv->settings, line, size))
...@@ -1506,8 +1505,7 @@ static irqreturn_t dscc4_irq(int irq, void *token) ...@@ -1506,8 +1505,7 @@ static irqreturn_t dscc4_irq(int irq, void *token)
writel(state, ioaddr + GSTAR); writel(state, ioaddr + GSTAR);
if (state & Arf) { if (state & Arf) {
printk(KERN_ERR "%s: failure (Arf). Harass the maintener\n", netdev_err(dev, "failure (Arf). Harass the maintainer\n");
dev->name);
goto out; goto out;
} }
state &= ~ArAck; state &= ~ArAck;
...@@ -1515,7 +1513,7 @@ static irqreturn_t dscc4_irq(int irq, void *token) ...@@ -1515,7 +1513,7 @@ static irqreturn_t dscc4_irq(int irq, void *token)
if (debug > 0) if (debug > 0)
printk(KERN_DEBUG "%s: CfgIV\n", DRV_NAME); printk(KERN_DEBUG "%s: CfgIV\n", DRV_NAME);
if (priv->iqcfg[priv->cfg_cur++%IRQ_RING_SIZE] & cpu_to_le32(Arf)) if (priv->iqcfg[priv->cfg_cur++%IRQ_RING_SIZE] & cpu_to_le32(Arf))
printk(KERN_ERR "%s: %s failed\n", dev->name, "CFG"); netdev_err(dev, "CFG failed\n");
if (!(state &= ~Cfg)) if (!(state &= ~Cfg))
goto out; goto out;
} }
...@@ -1596,8 +1594,8 @@ static void dscc4_tx_irq(struct dscc4_pci_priv *ppriv, ...@@ -1596,8 +1594,8 @@ static void dscc4_tx_irq(struct dscc4_pci_priv *ppriv,
++dpriv->tx_dirty; ++dpriv->tx_dirty;
} else { } else {
if (debug > 1) if (debug > 1)
printk(KERN_ERR "%s Tx: NULL skb %d\n", netdev_err(dev, "Tx: NULL skb %d\n",
dev->name, cur); cur);
} }
/* /*
* If the driver ends sending crap on the wire, it * If the driver ends sending crap on the wire, it
...@@ -1616,7 +1614,7 @@ static void dscc4_tx_irq(struct dscc4_pci_priv *ppriv, ...@@ -1616,7 +1614,7 @@ static void dscc4_tx_irq(struct dscc4_pci_priv *ppriv,
* Transmit Data Underrun * Transmit Data Underrun
*/ */
if (state & Xdu) { if (state & Xdu) {
printk(KERN_ERR "%s: XDU. Ask maintainer\n", DRV_NAME); netdev_err(dev, "Tx Data Underrun. Ask maintainer\n");
dpriv->flags = NeedIDT; dpriv->flags = NeedIDT;
/* Tx reset */ /* Tx reset */
writel(MTFi | Rdt, writel(MTFi | Rdt,
...@@ -1625,13 +1623,13 @@ static void dscc4_tx_irq(struct dscc4_pci_priv *ppriv, ...@@ -1625,13 +1623,13 @@ static void dscc4_tx_irq(struct dscc4_pci_priv *ppriv,
return; return;
} }
if (state & Cts) { if (state & Cts) {
printk(KERN_INFO "%s: CTS transition\n", dev->name); netdev_info(dev, "CTS transition\n");
if (!(state &= ~Cts)) /* DEBUG */ if (!(state &= ~Cts)) /* DEBUG */
goto try; goto try;
} }
if (state & Xmr) { if (state & Xmr) {
/* Frame needs to be sent again - FIXME */ /* Frame needs to be sent again - FIXME */
printk(KERN_ERR "%s: Xmr. Ask maintainer\n", DRV_NAME); netdev_err(dev, "Tx ReTx. Ask maintainer\n");
if (!(state &= ~Xmr)) /* DEBUG */ if (!(state &= ~Xmr)) /* DEBUG */
goto try; goto try;
} }
...@@ -1649,7 +1647,7 @@ static void dscc4_tx_irq(struct dscc4_pci_priv *ppriv, ...@@ -1649,7 +1647,7 @@ static void dscc4_tx_irq(struct dscc4_pci_priv *ppriv,
break; break;
} }
if (!i) if (!i)
printk(KERN_INFO "%s busy in irq\n", dev->name); netdev_info(dev, "busy in irq\n");
scc_addr = dpriv->base_addr + 0x0c*dpriv->dev_id; scc_addr = dpriv->base_addr + 0x0c*dpriv->dev_id;
/* Keep this order: IDT before IDR */ /* Keep this order: IDT before IDR */
...@@ -1686,7 +1684,7 @@ static void dscc4_tx_irq(struct dscc4_pci_priv *ppriv, ...@@ -1686,7 +1684,7 @@ static void dscc4_tx_irq(struct dscc4_pci_priv *ppriv,
} }
if (state & Cd) { if (state & Cd) {
if (debug > 0) if (debug > 0)
printk(KERN_INFO "%s: CD transition\n", dev->name); netdev_info(dev, "CD transition\n");
if (!(state &= ~Cd)) /* DEBUG */ if (!(state &= ~Cd)) /* DEBUG */
goto try; goto try;
} }
...@@ -1695,11 +1693,11 @@ static void dscc4_tx_irq(struct dscc4_pci_priv *ppriv, ...@@ -1695,11 +1693,11 @@ static void dscc4_tx_irq(struct dscc4_pci_priv *ppriv,
#ifdef DSCC4_POLLING #ifdef DSCC4_POLLING
while (!dscc4_tx_poll(dpriv, dev)); while (!dscc4_tx_poll(dpriv, dev));
#endif #endif
printk(KERN_INFO "%s: Tx Hi\n", dev->name); netdev_info(dev, "Tx Hi\n");
state &= ~Hi; state &= ~Hi;
} }
if (state & Err) { if (state & Err) {
printk(KERN_INFO "%s: Tx ERR\n", dev->name); netdev_info(dev, "Tx ERR\n");
dev->stats.tx_errors++; dev->stats.tx_errors++;
state &= ~Err; state &= ~Err;
} }
...@@ -1769,7 +1767,7 @@ static void dscc4_rx_irq(struct dscc4_pci_priv *priv, ...@@ -1769,7 +1767,7 @@ static void dscc4_rx_irq(struct dscc4_pci_priv *priv,
goto try; goto try;
} }
if (state & Hi ) { /* HI bit */ if (state & Hi ) { /* HI bit */
printk(KERN_INFO "%s: Rx Hi\n", dev->name); netdev_info(dev, "Rx Hi\n");
state &= ~Hi; state &= ~Hi;
goto try; goto try;
} }
...@@ -1800,7 +1798,7 @@ static void dscc4_rx_irq(struct dscc4_pci_priv *priv, ...@@ -1800,7 +1798,7 @@ static void dscc4_rx_irq(struct dscc4_pci_priv *priv,
goto try; goto try;
} }
if (state & Cts) { if (state & Cts) {
printk(KERN_INFO "%s: CTS transition\n", dev->name); netdev_info(dev, "CTS transition\n");
if (!(state &= ~Cts)) /* DEBUG */ if (!(state &= ~Cts)) /* DEBUG */
goto try; goto try;
} }
...@@ -1859,14 +1857,12 @@ static void dscc4_rx_irq(struct dscc4_pci_priv *priv, ...@@ -1859,14 +1857,12 @@ static void dscc4_rx_irq(struct dscc4_pci_priv *priv,
sizeof(struct RxFD), scc_addr + CH0BRDA); sizeof(struct RxFD), scc_addr + CH0BRDA);
writel(MTFi|Rdr|Idr, scc_addr + CH0CFG); writel(MTFi|Rdr|Idr, scc_addr + CH0CFG);
if (dscc4_do_action(dev, "RDR") < 0) { if (dscc4_do_action(dev, "RDR") < 0) {
printk(KERN_ERR "%s: RDO recovery failed(%s)\n", netdev_err(dev, "RDO recovery failed(RDR)\n");
dev->name, "RDR");
goto rdo_end; goto rdo_end;
} }
writel(MTFi|Idr, scc_addr + CH0CFG); writel(MTFi|Idr, scc_addr + CH0CFG);
if (dscc4_do_action(dev, "IDR") < 0) { if (dscc4_do_action(dev, "IDR") < 0) {
printk(KERN_ERR "%s: RDO recovery failed(%s)\n", netdev_err(dev, "RDO recovery failed(IDR)\n");
dev->name, "IDR");
goto rdo_end; goto rdo_end;
} }
rdo_end: rdo_end:
...@@ -1875,7 +1871,7 @@ static void dscc4_rx_irq(struct dscc4_pci_priv *priv, ...@@ -1875,7 +1871,7 @@ static void dscc4_rx_irq(struct dscc4_pci_priv *priv,
goto try; goto try;
} }
if (state & Cd) { if (state & Cd) {
printk(KERN_INFO "%s: CD transition\n", dev->name); netdev_info(dev, "CD transition\n");
if (!(state &= ~Cd)) /* DEBUG */ if (!(state &= ~Cd)) /* DEBUG */
goto try; goto try;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment