diff options
author | Joe Perches <joe@perches.com> | 2011-06-26 15:01:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-06-27 03:09:47 -0400 |
commit | 86fb0ccf90cc34642daf6cd902ee26516a0ff0a2 (patch) | |
tree | 0c83fcb3b5d006cb18a6b645702ddd848dcf48b8 /drivers/net/wan/sdla.c | |
parent | d6810e1375c9b3b28ed1caccb6fb706945903f49 (diff) |
frame relay dlci/frad: Update to current logging forms
Use pr_fmt, pr_<level> and netdev_<level> as appropriate.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan/sdla.c')
-rw-r--r-- | drivers/net/wan/sdla.c | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c index 3f4e2b5684db..c8531612eea9 100644 --- a/drivers/net/wan/sdla.c +++ b/drivers/net/wan/sdla.c | |||
@@ -32,6 +32,8 @@ | |||
32 | * 2 of the License, or (at your option) any later version. | 32 | * 2 of the License, or (at your option) any later version. |
33 | */ | 33 | */ |
34 | 34 | ||
35 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
36 | |||
35 | #include <linux/module.h> | 37 | #include <linux/module.h> |
36 | #include <linux/kernel.h> | 38 | #include <linux/kernel.h> |
37 | #include <linux/types.h> | 39 | #include <linux/types.h> |
@@ -350,24 +352,24 @@ static void sdla_errors(struct net_device *dev, int cmd, int dlci, int ret, int | |||
350 | case SDLA_RET_MODEM: | 352 | case SDLA_RET_MODEM: |
351 | state = data; | 353 | state = data; |
352 | if (*state & SDLA_MODEM_DCD_LOW) | 354 | if (*state & SDLA_MODEM_DCD_LOW) |
353 | printk(KERN_INFO "%s: Modem DCD unexpectedly low!\n", dev->name); | 355 | netdev_info(dev, "Modem DCD unexpectedly low!\n"); |
354 | if (*state & SDLA_MODEM_CTS_LOW) | 356 | if (*state & SDLA_MODEM_CTS_LOW) |
355 | printk(KERN_INFO "%s: Modem CTS unexpectedly low!\n", dev->name); | 357 | netdev_info(dev, "Modem CTS unexpectedly low!\n"); |
356 | /* I should probably do something about this! */ | 358 | /* I should probably do something about this! */ |
357 | break; | 359 | break; |
358 | 360 | ||
359 | case SDLA_RET_CHANNEL_OFF: | 361 | case SDLA_RET_CHANNEL_OFF: |
360 | printk(KERN_INFO "%s: Channel became inoperative!\n", dev->name); | 362 | netdev_info(dev, "Channel became inoperative!\n"); |
361 | /* same here */ | 363 | /* same here */ |
362 | break; | 364 | break; |
363 | 365 | ||
364 | case SDLA_RET_CHANNEL_ON: | 366 | case SDLA_RET_CHANNEL_ON: |
365 | printk(KERN_INFO "%s: Channel became operative!\n", dev->name); | 367 | netdev_info(dev, "Channel became operative!\n"); |
366 | /* same here */ | 368 | /* same here */ |
367 | break; | 369 | break; |
368 | 370 | ||
369 | case SDLA_RET_DLCI_STATUS: | 371 | case SDLA_RET_DLCI_STATUS: |
370 | printk(KERN_INFO "%s: Status change reported by Access Node.\n", dev->name); | 372 | netdev_info(dev, "Status change reported by Access Node\n"); |
371 | len /= sizeof(struct _dlci_stat); | 373 | len /= sizeof(struct _dlci_stat); |
372 | for(pstatus = data, i=0;i < len;i++,pstatus++) | 374 | for(pstatus = data, i=0;i < len;i++,pstatus++) |
373 | { | 375 | { |
@@ -382,29 +384,32 @@ static void sdla_errors(struct net_device *dev, int cmd, int dlci, int ret, int | |||
382 | sprintf(line, "unknown status: %02X", pstatus->flags); | 384 | sprintf(line, "unknown status: %02X", pstatus->flags); |
383 | state = line; | 385 | state = line; |
384 | } | 386 | } |
385 | printk(KERN_INFO "%s: DLCI %i: %s.\n", dev->name, pstatus->dlci, state); | 387 | netdev_info(dev, "DLCI %i: %s\n", |
388 | pstatus->dlci, state); | ||
386 | /* same here */ | 389 | /* same here */ |
387 | } | 390 | } |
388 | break; | 391 | break; |
389 | 392 | ||
390 | case SDLA_RET_DLCI_UNKNOWN: | 393 | case SDLA_RET_DLCI_UNKNOWN: |
391 | printk(KERN_INFO "%s: Received unknown DLCIs:", dev->name); | 394 | netdev_info(dev, "Received unknown DLCIs:"); |
392 | len /= sizeof(short); | 395 | len /= sizeof(short); |
393 | for(pdlci = data,i=0;i < len;i++,pdlci++) | 396 | for(pdlci = data,i=0;i < len;i++,pdlci++) |
394 | printk(" %i", *pdlci); | 397 | pr_cont(" %i", *pdlci); |
395 | printk("\n"); | 398 | pr_cont("\n"); |
396 | break; | 399 | break; |
397 | 400 | ||
398 | case SDLA_RET_TIMEOUT: | 401 | case SDLA_RET_TIMEOUT: |
399 | printk(KERN_ERR "%s: Command timed out!\n", dev->name); | 402 | netdev_err(dev, "Command timed out!\n"); |
400 | break; | 403 | break; |
401 | 404 | ||
402 | case SDLA_RET_BUF_OVERSIZE: | 405 | case SDLA_RET_BUF_OVERSIZE: |
403 | printk(KERN_INFO "%s: Bc/CIR overflow, acceptable size is %i\n", dev->name, len); | 406 | netdev_info(dev, "Bc/CIR overflow, acceptable size is %i\n", |
407 | len); | ||
404 | break; | 408 | break; |
405 | 409 | ||
406 | case SDLA_RET_BUF_TOO_BIG: | 410 | case SDLA_RET_BUF_TOO_BIG: |
407 | printk(KERN_INFO "%s: Buffer size over specified max of %i\n", dev->name, len); | 411 | netdev_info(dev, "Buffer size over specified max of %i\n", |
412 | len); | ||
408 | break; | 413 | break; |
409 | 414 | ||
410 | case SDLA_RET_CHANNEL_INACTIVE: | 415 | case SDLA_RET_CHANNEL_INACTIVE: |
@@ -415,7 +420,8 @@ static void sdla_errors(struct net_device *dev, int cmd, int dlci, int ret, int | |||
415 | break; | 420 | break; |
416 | 421 | ||
417 | default: | 422 | default: |
418 | printk(KERN_DEBUG "%s: Cmd 0x%2.2X generated return code 0x%2.2X\n", dev->name, cmd, ret); | 423 | netdev_dbg(dev, "Cmd 0x%02X generated return code 0x%02X\n", |
424 | cmd, ret); | ||
419 | /* Further processing could be done here */ | 425 | /* Further processing could be done here */ |
420 | break; | 426 | break; |
421 | } | 427 | } |
@@ -678,12 +684,14 @@ static netdev_tx_t sdla_transmit(struct sk_buff *skb, | |||
678 | case ARPHRD_FRAD: | 684 | case ARPHRD_FRAD: |
679 | if (skb->dev->type != ARPHRD_DLCI) | 685 | if (skb->dev->type != ARPHRD_DLCI) |
680 | { | 686 | { |
681 | printk(KERN_WARNING "%s: Non DLCI device, type %i, tried to send on FRAD module.\n", dev->name, skb->dev->type); | 687 | netdev_warn(dev, "Non DLCI device, type %i, tried to send on FRAD module\n", |
688 | skb->dev->type); | ||
682 | accept = 0; | 689 | accept = 0; |
683 | } | 690 | } |
684 | break; | 691 | break; |
685 | default: | 692 | default: |
686 | printk(KERN_WARNING "%s: unknown firmware type 0x%4.4X\n", dev->name, dev->type); | 693 | netdev_warn(dev, "unknown firmware type 0x%04X\n", |
694 | dev->type); | ||
687 | accept = 0; | 695 | accept = 0; |
688 | break; | 696 | break; |
689 | } | 697 | } |
@@ -807,7 +815,8 @@ static void sdla_receive(struct net_device *dev) | |||
807 | 815 | ||
808 | if (i == CONFIG_DLCI_MAX) | 816 | if (i == CONFIG_DLCI_MAX) |
809 | { | 817 | { |
810 | printk(KERN_NOTICE "%s: Received packet from invalid DLCI %i, ignoring.", dev->name, dlci); | 818 | netdev_notice(dev, "Received packet from invalid DLCI %i, ignoring\n", |
819 | dlci); | ||
811 | dev->stats.rx_errors++; | 820 | dev->stats.rx_errors++; |
812 | success = 0; | 821 | success = 0; |
813 | } | 822 | } |
@@ -819,7 +828,7 @@ static void sdla_receive(struct net_device *dev) | |||
819 | skb = dev_alloc_skb(len + sizeof(struct frhdr)); | 828 | skb = dev_alloc_skb(len + sizeof(struct frhdr)); |
820 | if (skb == NULL) | 829 | if (skb == NULL) |
821 | { | 830 | { |
822 | printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name); | 831 | netdev_notice(dev, "Memory squeeze, dropping packet\n"); |
823 | dev->stats.rx_dropped++; | 832 | dev->stats.rx_dropped++; |
824 | success = 0; | 833 | success = 0; |
825 | } | 834 | } |
@@ -880,8 +889,7 @@ static irqreturn_t sdla_isr(int dummy, void *dev_id) | |||
880 | 889 | ||
881 | if (!flp->initialized) | 890 | if (!flp->initialized) |
882 | { | 891 | { |
883 | printk(KERN_WARNING "%s: irq %d for uninitialized device.\n", | 892 | netdev_warn(dev, "irq %d for uninitialized device\n", dev->irq); |
884 | dev->name, dev->irq); | ||
885 | return IRQ_NONE; | 893 | return IRQ_NONE; |
886 | } | 894 | } |
887 | 895 | ||
@@ -901,7 +909,7 @@ static irqreturn_t sdla_isr(int dummy, void *dev_id) | |||
901 | case SDLA_INTR_TX: | 909 | case SDLA_INTR_TX: |
902 | case SDLA_INTR_COMPLETE: | 910 | case SDLA_INTR_COMPLETE: |
903 | case SDLA_INTR_TIMER: | 911 | case SDLA_INTR_TIMER: |
904 | printk(KERN_WARNING "%s: invalid irq flag 0x%02X.\n", dev->name, byte); | 912 | netdev_warn(dev, "invalid irq flag 0x%02X\n", byte); |
905 | break; | 913 | break; |
906 | } | 914 | } |
907 | 915 | ||
@@ -1347,7 +1355,7 @@ static int sdla_set_config(struct net_device *dev, struct ifmap *map) | |||
1347 | return -EINVAL; | 1355 | return -EINVAL; |
1348 | 1356 | ||
1349 | if (!request_region(map->base_addr, SDLA_IO_EXTENTS, dev->name)){ | 1357 | if (!request_region(map->base_addr, SDLA_IO_EXTENTS, dev->name)){ |
1350 | printk(KERN_WARNING "SDLA: io-port 0x%04lx in use\n", dev->base_addr); | 1358 | pr_warn("io-port 0x%04lx in use\n", dev->base_addr); |
1351 | return -EINVAL; | 1359 | return -EINVAL; |
1352 | } | 1360 | } |
1353 | base = map->base_addr; | 1361 | base = map->base_addr; |
@@ -1412,7 +1420,7 @@ static int sdla_set_config(struct net_device *dev, struct ifmap *map) | |||
1412 | } | 1420 | } |
1413 | } | 1421 | } |
1414 | 1422 | ||
1415 | printk(KERN_NOTICE "%s: Unknown card type\n", dev->name); | 1423 | netdev_notice(dev, "Unknown card type\n"); |
1416 | err = -ENODEV; | 1424 | err = -ENODEV; |
1417 | goto fail; | 1425 | goto fail; |
1418 | 1426 | ||