Commit 99d8d215 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

irda: w83977af_ir: Neaten logging

Use more common logging style, standardize function output logging use.

Miscellanea:

o Add and use pr_fmt
o Convert printks to pr_<level>
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 646bf092
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
* *
********************************************************************/ ********************************************************************/
#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/types.h> #include <linux/types.h>
...@@ -155,7 +157,7 @@ static int w83977af_open(int i, unsigned int iobase, unsigned int irq, ...@@ -155,7 +157,7 @@ static int w83977af_open(int i, unsigned int iobase, unsigned int irq,
/* Lock the port that we need */ /* Lock the port that we need */
if (!request_region(iobase, CHIP_IO_EXTENT, driver_name)) { if (!request_region(iobase, CHIP_IO_EXTENT, driver_name)) {
pr_debug("%s(), can't get iobase of 0x%03x\n", pr_debug("%s: can't get iobase of 0x%03x\n",
__func__, iobase); __func__, iobase);
return -ENODEV; return -ENODEV;
} }
...@@ -169,8 +171,7 @@ static int w83977af_open(int i, unsigned int iobase, unsigned int irq, ...@@ -169,8 +171,7 @@ static int w83977af_open(int i, unsigned int iobase, unsigned int irq,
*/ */
dev = alloc_irdadev(sizeof(struct w83977af_ir)); dev = alloc_irdadev(sizeof(struct w83977af_ir));
if (!dev) { if (!dev) {
printk(KERN_ERR "IrDA: Can't allocate memory for " pr_err("IrDA: Can't allocate memory for IrDA control block!\n");
"IrDA control block!\n");
err = -ENOMEM; err = -ENOMEM;
goto err_out; goto err_out;
} }
...@@ -229,7 +230,7 @@ static int w83977af_open(int i, unsigned int iobase, unsigned int irq, ...@@ -229,7 +230,7 @@ static int w83977af_open(int i, unsigned int iobase, unsigned int irq,
err = register_netdev(dev); err = register_netdev(dev);
if (err) { if (err) {
net_err_ratelimited("%s(), register_netdevice() failed!\n", net_err_ratelimited("%s:, register_netdevice() failed!\n",
__func__); __func__);
goto err_out3; goto err_out3;
} }
...@@ -280,8 +281,7 @@ static int w83977af_close(struct w83977af_ir *self) ...@@ -280,8 +281,7 @@ static int w83977af_close(struct w83977af_ir *self)
unregister_netdev(self->netdev); unregister_netdev(self->netdev);
/* Release the PORT that this driver is using */ /* Release the PORT that this driver is using */
pr_debug("%s(), Releasing Region %03x\n", pr_debug("%s: Releasing Region %03x\n", __func__, self->io.fir_base);
__func__, self->io.fir_base);
release_region(self->io.fir_base, self->io.fir_ext); release_region(self->io.fir_base, self->io.fir_ext);
if (self->tx_buff.head) if (self->tx_buff.head)
...@@ -389,7 +389,7 @@ static int w83977af_probe(int iobase, int irq, int dma) ...@@ -389,7 +389,7 @@ static int w83977af_probe(int iobase, int irq, int dma)
return 0; return 0;
} else { } else {
/* Try next extented function register address */ /* Try next extented function register address */
pr_debug("%s(), Wrong chip version", __func__); pr_debug("%s: Wrong chip version\n", __func__);
} }
} }
return -1; return -1;
...@@ -425,19 +425,19 @@ static void w83977af_change_speed(struct w83977af_ir *self, __u32 speed) ...@@ -425,19 +425,19 @@ static void w83977af_change_speed(struct w83977af_ir *self, __u32 speed)
case 115200: outb(0x01, iobase + ABLL); break; case 115200: outb(0x01, iobase + ABLL); break;
case 576000: case 576000:
ir_mode = HCR_MIR_576; ir_mode = HCR_MIR_576;
pr_debug("%s(), handling baud of 576000\n", __func__); pr_debug("%s: handling baud of 576000\n", __func__);
break; break;
case 1152000: case 1152000:
ir_mode = HCR_MIR_1152; ir_mode = HCR_MIR_1152;
pr_debug("%s(), handling baud of 1152000\n", __func__); pr_debug("%s: handling baud of 1152000\n", __func__);
break; break;
case 4000000: case 4000000:
ir_mode = HCR_FIR; ir_mode = HCR_FIR;
pr_debug("%s(), handling baud of 4000000\n", __func__); pr_debug("%s: handling baud of 4000000\n", __func__);
break; break;
default: default:
ir_mode = HCR_FIR; ir_mode = HCR_FIR;
pr_debug("%s(), unknown baud rate of %d\n", __func__, speed); pr_debug("%s: unknown baud rate of %d\n", __func__, speed);
break; break;
} }
...@@ -489,8 +489,7 @@ static netdev_tx_t w83977af_hard_xmit(struct sk_buff *skb, ...@@ -489,8 +489,7 @@ static netdev_tx_t w83977af_hard_xmit(struct sk_buff *skb,
iobase = self->io.fir_base; iobase = self->io.fir_base;
pr_debug("%s(%ld), skb->len=%d\n", __func__, jiffies, pr_debug("%s: %ld, skb->len=%d\n", __func__, jiffies, (int)skb->len);
(int)skb->len);
/* Lock transmit buffer */ /* Lock transmit buffer */
netif_stop_queue(dev); netif_stop_queue(dev);
...@@ -517,10 +516,10 @@ static netdev_tx_t w83977af_hard_xmit(struct sk_buff *skb, ...@@ -517,10 +516,10 @@ static netdev_tx_t w83977af_hard_xmit(struct sk_buff *skb,
self->tx_buff.len = skb->len; self->tx_buff.len = skb->len;
mtt = irda_get_mtt(skb); mtt = irda_get_mtt(skb);
pr_debug("%s(%ld), mtt=%d\n", __func__, jiffies, mtt); pr_debug("%s: %ld, mtt=%d\n", __func__, jiffies, mtt);
if (mtt > 1000) if (mtt > 1000)
mdelay(mtt / 1000); mdelay(mtt / 1000);
else if (mtt) else if (mtt)
udelay(mtt); udelay(mtt);
/* Enable DMA interrupt */ /* Enable DMA interrupt */
...@@ -554,7 +553,7 @@ static void w83977af_dma_write(struct w83977af_ir *self, int iobase) ...@@ -554,7 +553,7 @@ static void w83977af_dma_write(struct w83977af_ir *self, int iobase)
{ {
__u8 set; __u8 set;
pr_debug("%s(), len=%d\n", __func__, self->tx_buff.len); pr_debug("%s: len=%d\n", __func__, self->tx_buff.len);
/* Save current set */ /* Save current set */
set = inb(iobase + SSR); set = inb(iobase + SSR);
...@@ -594,11 +593,10 @@ static int w83977af_pio_write(int iobase, __u8 *buf, int len, int fifo_size) ...@@ -594,11 +593,10 @@ static int w83977af_pio_write(int iobase, __u8 *buf, int len, int fifo_size)
switch_bank(iobase, SET0); switch_bank(iobase, SET0);
if (!(inb_p(iobase + USR) & USR_TSRE)) { if (!(inb_p(iobase + USR) & USR_TSRE)) {
pr_debug("%s(), warning, FIFO not empty yet!\n", __func__); pr_debug("%s: warning, FIFO not empty yet!\n", __func__);
fifo_size -= 17; fifo_size -= 17;
pr_debug("%s(), %d bytes left in tx fifo\n", pr_debug("%s: %d bytes left in tx fifo\n", __func__, fifo_size);
__func__, fifo_size);
} }
/* Fill FIFO with current frame */ /* Fill FIFO with current frame */
...@@ -607,7 +605,7 @@ static int w83977af_pio_write(int iobase, __u8 *buf, int len, int fifo_size) ...@@ -607,7 +605,7 @@ static int w83977af_pio_write(int iobase, __u8 *buf, int len, int fifo_size)
outb(buf[actual++], iobase + TBR); outb(buf[actual++], iobase + TBR);
} }
pr_debug("%s(), fifo_size %d ; %d sent of %d\n", pr_debug("%s: fifo_size %d ; %d sent of %d\n",
__func__, fifo_size, actual, len); __func__, fifo_size, actual, len);
/* Restore bank */ /* Restore bank */
...@@ -628,7 +626,7 @@ static void w83977af_dma_xmit_complete(struct w83977af_ir *self) ...@@ -628,7 +626,7 @@ static void w83977af_dma_xmit_complete(struct w83977af_ir *self)
int iobase; int iobase;
__u8 set; __u8 set;
pr_debug("%s(%ld)\n", __func__, jiffies); pr_debug("%s: %ld\n", __func__, jiffies);
IRDA_ASSERT(self, return;); IRDA_ASSERT(self, return;);
...@@ -643,7 +641,7 @@ static void w83977af_dma_xmit_complete(struct w83977af_ir *self) ...@@ -643,7 +641,7 @@ static void w83977af_dma_xmit_complete(struct w83977af_ir *self)
/* Check for underrun! */ /* Check for underrun! */
if (inb(iobase + AUDR) & AUDR_UNDR) { if (inb(iobase + AUDR) & AUDR_UNDR) {
pr_debug("%s(), Transmit underrun!\n", __func__); pr_debug("%s: Transmit underrun!\n", __func__);
self->netdev->stats.tx_errors++; self->netdev->stats.tx_errors++;
self->netdev->stats.tx_fifo_errors++; self->netdev->stats.tx_fifo_errors++;
...@@ -820,8 +818,8 @@ static int w83977af_dma_receive_complete(struct w83977af_ir *self) ...@@ -820,8 +818,8 @@ static int w83977af_dma_receive_complete(struct w83977af_ir *self)
skb = dev_alloc_skb(len + 1); skb = dev_alloc_skb(len + 1);
if (!skb) { if (!skb) {
printk(KERN_INFO pr_info("%s: memory squeeze, dropping frame\n",
"%s(), memory squeeze, dropping frame.\n", __func__); __func__);
/* Restore set register */ /* Restore set register */
outb(set, iobase + SSR); outb(set, iobase + SSR);
...@@ -896,7 +894,7 @@ static __u8 w83977af_sir_interrupt(struct w83977af_ir *self, int isr) ...@@ -896,7 +894,7 @@ static __u8 w83977af_sir_interrupt(struct w83977af_ir *self, int isr)
__u8 set; __u8 set;
int iobase; int iobase;
pr_debug("%s(), isr=%#x\n", __func__, isr); pr_debug("%s: isr=%#x\n", __func__, isr);
iobase = self->io.fir_base; iobase = self->io.fir_base;
/* Transmit FIFO low on data */ /* Transmit FIFO low on data */
...@@ -932,7 +930,7 @@ static __u8 w83977af_sir_interrupt(struct w83977af_ir *self, int isr) ...@@ -932,7 +930,7 @@ static __u8 w83977af_sir_interrupt(struct w83977af_ir *self, int isr)
if (isr & ISR_TXEMP_I) { if (isr & ISR_TXEMP_I) {
/* Check if we need to change the speed? */ /* Check if we need to change the speed? */
if (self->new_speed) { if (self->new_speed) {
pr_debug("%s(), Changing speed!\n", __func__); pr_debug("%s: Changing speed!\n", __func__);
w83977af_change_speed(self, self->new_speed); w83977af_change_speed(self, self->new_speed);
self->new_speed = 0; self->new_speed = 0;
} }
...@@ -1229,7 +1227,7 @@ static int w83977af_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -1229,7 +1227,7 @@ static int w83977af_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
IRDA_ASSERT(self, return -1;); IRDA_ASSERT(self, return -1;);
pr_debug("%s(), %s, (cmd=0x%X)\n", __func__, dev->name, cmd); pr_debug("%s: %s, (cmd=0x%X)\n", __func__, dev->name, cmd);
spin_lock_irqsave(&self->lock, flags); spin_lock_irqsave(&self->lock, flags);
......
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