Commit 9cbe50d4231773396f529f51a048770d0ee54ac1

Authored by Joe Perches
Committed by David S. Miller
1 parent 12a3bfefc8

cosa: 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>

Showing 1 changed file with 106 additions and 120 deletions Side-by-side Diff

drivers/net/wan/cosa.c
... ... @@ -74,6 +74,8 @@
74 74 * The Sync PPP/Cisco HDLC layer (syncppp.c) ported to Linux by Alan Cox
75 75 */
76 76  
  77 +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  78 +
77 79 #include <linux/module.h>
78 80 #include <linux/kernel.h>
79 81 #include <linux/sched.h>
80 82  
... ... @@ -361,14 +363,13 @@
361 363  
362 364 if (cosa_major > 0) {
363 365 if (register_chrdev(cosa_major, "cosa", &cosa_fops)) {
364   - printk(KERN_WARNING "cosa: unable to get major %d\n",
365   - cosa_major);
  366 + pr_warn("unable to get major %d\n", cosa_major);
366 367 err = -EIO;
367 368 goto out;
368 369 }
369 370 } else {
370 371 if (!(cosa_major=register_chrdev(0, "cosa", &cosa_fops))) {
371   - printk(KERN_WARNING "cosa: unable to register chardev\n");
  372 + pr_warn("unable to register chardev\n");
372 373 err = -EIO;
373 374 goto out;
374 375 }
... ... @@ -378,7 +379,7 @@
378 379 for (i=0; io[i] != 0 && i < MAX_CARDS; i++)
379 380 cosa_probe(io[i], irq[i], dma[i]);
380 381 if (!nr_cards) {
381   - printk(KERN_WARNING "cosa: no devices found.\n");
  382 + pr_warn("no devices found\n");
382 383 unregister_chrdev(cosa_major, "cosa");
383 384 err = -ENODEV;
384 385 goto out;
385 386  
386 387  
387 388  
... ... @@ -447,26 +448,25 @@
447 448 /* Checking validity of parameters: */
448 449 /* IRQ should be 2-7 or 10-15; negative IRQ means autoprobe */
449 450 if ((irq >= 0 && irq < 2) || irq > 15 || (irq < 10 && irq > 7)) {
450   - printk (KERN_INFO "cosa_probe: invalid IRQ %d\n", irq);
  451 + pr_info("invalid IRQ %d\n", irq);
451 452 return -1;
452 453 }
453 454 /* I/O address should be between 0x100 and 0x3ff and should be
454 455 * multiple of 8. */
455 456 if (base < 0x100 || base > 0x3ff || base & 0x7) {
456   - printk (KERN_INFO "cosa_probe: invalid I/O address 0x%x\n",
457   - base);
  457 + pr_info("invalid I/O address 0x%x\n", base);
458 458 return -1;
459 459 }
460 460 /* DMA should be 0,1 or 3-7 */
461 461 if (dma < 0 || dma == 4 || dma > 7) {
462   - printk (KERN_INFO "cosa_probe: invalid DMA %d\n", dma);
  462 + pr_info("invalid DMA %d\n", dma);
463 463 return -1;
464 464 }
465 465 /* and finally, on 16-bit COSA DMA should be 4-7 and
466 466 * I/O base should not be multiple of 0x10 */
467 467 if (((base & 0x8) && dma < 4) || (!(base & 0x8) && dma > 3)) {
468   - printk (KERN_INFO "cosa_probe: 8/16 bit base and DMA mismatch"
469   - " (base=0x%x, dma=%d)\n", base, dma);
  468 + pr_info("8/16 bit base and DMA mismatch (base=0x%x, dma=%d)\n",
  469 + base, dma);
470 470 return -1;
471 471 }
472 472  
... ... @@ -479,7 +479,7 @@
479 479 return -1;
480 480  
481 481 if (cosa_reset_and_read_id(cosa, cosa->id_string) < 0) {
482   - printk(KERN_DEBUG "cosa: probe at 0x%x failed.\n", base);
  482 + printk(KERN_DEBUG "probe at 0x%x failed.\n", base);
483 483 err = -1;
484 484 goto err_out;
485 485 }
... ... @@ -492,8 +492,7 @@
492 492 else {
493 493 /* Print a warning only if we are not autoprobing */
494 494 #ifndef COSA_ISA_AUTOPROBE
495   - printk(KERN_INFO "cosa: valid signature not found at 0x%x.\n",
496   - base);
  495 + pr_info("valid signature not found at 0x%x\n", base);
497 496 #endif
498 497 err = -1;
499 498 goto err_out;
500 499  
... ... @@ -501,14 +500,14 @@
501 500 /* Update the name of the region now we know the type of card */
502 501 release_region(base, is_8bit(cosa)?2:4);
503 502 if (!request_region(base, is_8bit(cosa)?2:4, cosa->type)) {
504   - printk(KERN_DEBUG "cosa: changing name at 0x%x failed.\n", base);
  503 + printk(KERN_DEBUG "changing name at 0x%x failed.\n", base);
505 504 return -1;
506 505 }
507 506  
508 507 /* Now do IRQ autoprobe */
509 508 if (irq < 0) {
510 509 unsigned long irqs;
511   -/* printk(KERN_INFO "IRQ autoprobe\n"); */
  510 +/* pr_info("IRQ autoprobe\n"); */
512 511 irqs = probe_irq_on();
513 512 /*
514 513 * Enable interrupt on tx buffer empty (it sure is)
515 514  
... ... @@ -526,13 +525,13 @@
526 525 cosa_getdata8(cosa);
527 526  
528 527 if (irq < 0) {
529   - printk (KERN_INFO "cosa IRQ autoprobe: multiple interrupts obtained (%d, board at 0x%x)\n",
  528 + pr_info("multiple interrupts obtained (%d, board at 0x%x)\n",
530 529 irq, cosa->datareg);
531 530 err = -1;
532 531 goto err_out;
533 532 }
534 533 if (irq == 0) {
535   - printk (KERN_INFO "cosa IRQ autoprobe: no interrupt obtained (board at 0x%x)\n",
  534 + pr_info("no interrupt obtained (board at 0x%x)\n",
536 535 cosa->datareg);
537 536 /* return -1; */
538 537 }
... ... @@ -579,8 +578,7 @@
579 578  
580 579 /* Register the network interface */
581 580 if (!(chan->netdev = alloc_hdlcdev(chan))) {
582   - printk(KERN_WARNING "%s: alloc_hdlcdev failed.\n",
583   - chan->name);
  581 + pr_warn("%s: alloc_hdlcdev failed\n", chan->name);
584 582 goto err_hdlcdev;
585 583 }
586 584 dev_to_hdlc(chan->netdev)->attach = cosa_net_attach;
587 585  
... ... @@ -591,14 +589,14 @@
591 589 chan->netdev->irq = chan->cosa->irq;
592 590 chan->netdev->dma = chan->cosa->dma;
593 591 if (register_hdlc_device(chan->netdev)) {
594   - printk(KERN_WARNING "%s: register_hdlc_device()"
595   - " failed.\n", chan->netdev->name);
  592 + netdev_warn(chan->netdev,
  593 + "register_hdlc_device() failed\n");
596 594 free_netdev(chan->netdev);
597 595 goto err_hdlcdev;
598 596 }
599 597 }
600 598  
601   - printk (KERN_INFO "cosa%d: %s (%s at 0x%x irq %d dma %d), %d channels\n",
  599 + pr_info("cosa%d: %s (%s at 0x%x irq %d dma %d), %d channels\n",
602 600 cosa->num, cosa->id_string, cosa->type,
603 601 cosa->datareg, cosa->irq, cosa->dma, cosa->nchannels);
604 602  
... ... @@ -618,8 +616,7 @@
618 616 free_irq(cosa->irq, cosa);
619 617 err_out:
620 618 release_region(cosa->datareg,is_8bit(cosa)?2:4);
621   - printk(KERN_NOTICE "cosa%d: allocating resources failed\n",
622   - cosa->num);
  619 + pr_notice("cosa%d: allocating resources failed\n", cosa->num);
623 620 return err;
624 621 }
625 622  
626 623  
... ... @@ -641,14 +638,14 @@
641 638 unsigned long flags;
642 639  
643 640 if (!(chan->cosa->firmware_status & COSA_FW_START)) {
644   - printk(KERN_NOTICE "%s: start the firmware first (status %d)\n",
645   - chan->cosa->name, chan->cosa->firmware_status);
  641 + pr_notice("%s: start the firmware first (status %d)\n",
  642 + chan->cosa->name, chan->cosa->firmware_status);
646 643 return -EPERM;
647 644 }
648 645 spin_lock_irqsave(&chan->cosa->lock, flags);
649 646 if (chan->usage != 0) {
650   - printk(KERN_WARNING "%s: cosa_net_open called with usage count"
651   - " %d\n", chan->name, chan->usage);
  647 + pr_warn("%s: cosa_net_open called with usage count %d\n",
  648 + chan->name, chan->usage);
652 649 spin_unlock_irqrestore(&chan->cosa->lock, flags);
653 650 return -EBUSY;
654 651 }
... ... @@ -736,8 +733,7 @@
736 733 kfree_skb(chan->rx_skb);
737 734 chan->rx_skb = dev_alloc_skb(size);
738 735 if (chan->rx_skb == NULL) {
739   - printk(KERN_NOTICE "%s: Memory squeeze, dropping packet\n",
740   - chan->name);
  736 + pr_notice("%s: Memory squeeze, dropping packet\n", chan->name);
741 737 chan->netdev->stats.rx_dropped++;
742 738 return NULL;
743 739 }
... ... @@ -748,8 +744,7 @@
748 744 static int cosa_net_rx_done(struct channel_data *chan)
749 745 {
750 746 if (!chan->rx_skb) {
751   - printk(KERN_WARNING "%s: rx_done with empty skb!\n",
752   - chan->name);
  747 + pr_warn("%s: rx_done with empty skb!\n", chan->name);
753 748 chan->netdev->stats.rx_errors++;
754 749 chan->netdev->stats.rx_frame_errors++;
755 750 return 0;
... ... @@ -768,8 +763,7 @@
768 763 static int cosa_net_tx_done(struct channel_data *chan, int size)
769 764 {
770 765 if (!chan->tx_skb) {
771   - printk(KERN_WARNING "%s: tx_done with empty skb!\n",
772   - chan->name);
  766 + pr_warn("%s: tx_done with empty skb!\n", chan->name);
773 767 chan->netdev->stats.tx_errors++;
774 768 chan->netdev->stats.tx_aborted_errors++;
775 769 return 1;
776 770  
... ... @@ -794,15 +788,15 @@
794 788 char *kbuf;
795 789  
796 790 if (!(cosa->firmware_status & COSA_FW_START)) {
797   - printk(KERN_NOTICE "%s: start the firmware first (status %d)\n",
798   - cosa->name, cosa->firmware_status);
  791 + pr_notice("%s: start the firmware first (status %d)\n",
  792 + cosa->name, cosa->firmware_status);
799 793 return -EPERM;
800 794 }
801 795 if (mutex_lock_interruptible(&chan->rlock))
802 796 return -ERESTARTSYS;
803 797  
804 798 if ((chan->rxdata = kmalloc(COSA_MTU, GFP_DMA|GFP_KERNEL)) == NULL) {
805   - printk(KERN_INFO "%s: cosa_read() - OOM\n", cosa->name);
  799 + pr_info("%s: cosa_read() - OOM\n", cosa->name);
806 800 mutex_unlock(&chan->rlock);
807 801 return -ENOMEM;
808 802 }
... ... @@ -869,8 +863,8 @@
869 863 char *kbuf;
870 864  
871 865 if (!(cosa->firmware_status & COSA_FW_START)) {
872   - printk(KERN_NOTICE "%s: start the firmware first (status %d)\n",
873   - cosa->name, cosa->firmware_status);
  866 + pr_notice("%s: start the firmware first (status %d)\n",
  867 + cosa->name, cosa->firmware_status);
874 868 return -EPERM;
875 869 }
876 870 if (down_interruptible(&chan->wsem))
... ... @@ -881,8 +875,8 @@
881 875  
882 876 /* Allocate the buffer */
883 877 if ((kbuf = kmalloc(count, GFP_KERNEL|GFP_DMA)) == NULL) {
884   - printk(KERN_NOTICE "%s: cosa_write() OOM - dropping packet\n",
885   - cosa->name);
  878 + pr_notice("%s: cosa_write() OOM - dropping packet\n",
  879 + cosa->name);
886 880 up(&chan->wsem);
887 881 return -ENOMEM;
888 882 }
... ... @@ -932,7 +926,7 @@
932 926  
933 927 static unsigned int cosa_poll(struct file *file, poll_table *poll)
934 928 {
935   - printk(KERN_INFO "cosa_poll is here\n");
  929 + pr_info("cosa_poll is here\n");
936 930 return 0;
937 931 }
938 932  
939 933  
940 934  
... ... @@ -1017,15 +1011,14 @@
1017 1011 {
1018 1012 char idstring[COSA_MAX_ID_STRING];
1019 1013 if (cosa->usage > 1)
1020   - printk(KERN_INFO "cosa%d: WARNING: reset requested with cosa->usage > 1 (%d). Odd things may happen.\n",
  1014 + pr_info("cosa%d: WARNING: reset requested with cosa->usage > 1 (%d). Odd things may happen.\n",
1021 1015 cosa->num, cosa->usage);
1022 1016 cosa->firmware_status &= ~(COSA_FW_RESET|COSA_FW_START);
1023 1017 if (cosa_reset_and_read_id(cosa, idstring) < 0) {
1024   - printk(KERN_NOTICE "cosa%d: reset failed\n", cosa->num);
  1018 + pr_notice("cosa%d: reset failed\n", cosa->num);
1025 1019 return -EIO;
1026 1020 }
1027   - printk(KERN_INFO "cosa%d: resetting device: %s\n", cosa->num,
1028   - idstring);
  1021 + pr_info("cosa%d: resetting device: %s\n", cosa->num, idstring);
1029 1022 cosa->firmware_status |= COSA_FW_RESET;
1030 1023 return 0;
1031 1024 }
1032 1025  
... ... @@ -1037,11 +1030,11 @@
1037 1030 int i;
1038 1031  
1039 1032 if (cosa->usage > 1)
1040   - printk(KERN_INFO "%s: WARNING: download of microcode requested with cosa->usage > 1 (%d). Odd things may happen.\n",
  1033 + pr_info("%s: WARNING: download of microcode requested with cosa->usage > 1 (%d). Odd things may happen.\n",
1041 1034 cosa->name, cosa->usage);
1042 1035 if (!(cosa->firmware_status & COSA_FW_RESET)) {
1043   - printk(KERN_NOTICE "%s: reset the card first (status %d).\n",
1044   - cosa->name, cosa->firmware_status);
  1036 + pr_notice("%s: reset the card first (status %d)\n",
  1037 + cosa->name, cosa->firmware_status);
1045 1038 return -EPERM;
1046 1039 }
1047 1040  
1048 1041  
... ... @@ -1059,11 +1052,11 @@
1059 1052  
1060 1053 i = download(cosa, d.code, d.len, d.addr);
1061 1054 if (i < 0) {
1062   - printk(KERN_NOTICE "cosa%d: microcode download failed: %d\n",
1063   - cosa->num, i);
  1055 + pr_notice("cosa%d: microcode download failed: %d\n",
  1056 + cosa->num, i);
1064 1057 return -EIO;
1065 1058 }
1066   - printk(KERN_INFO "cosa%d: downloading microcode - 0x%04x bytes at 0x%04x\n",
  1059 + pr_info("cosa%d: downloading microcode - 0x%04x bytes at 0x%04x\n",
1067 1060 cosa->num, d.len, d.addr);
1068 1061 cosa->firmware_status |= COSA_FW_RESET|COSA_FW_DOWNLOAD;
1069 1062 return 0;
1070 1063  
... ... @@ -1076,12 +1069,11 @@
1076 1069 int i;
1077 1070  
1078 1071 if (cosa->usage > 1)
1079   - printk(KERN_INFO "cosa%d: WARNING: readmem requested with "
1080   - "cosa->usage > 1 (%d). Odd things may happen.\n",
  1072 + pr_info("cosa%d: WARNING: readmem requested with cosa->usage > 1 (%d). Odd things may happen.\n",
1081 1073 cosa->num, cosa->usage);
1082 1074 if (!(cosa->firmware_status & COSA_FW_RESET)) {
1083   - printk(KERN_NOTICE "%s: reset the card first (status %d).\n",
1084   - cosa->name, cosa->firmware_status);
  1075 + pr_notice("%s: reset the card first (status %d)\n",
  1076 + cosa->name, cosa->firmware_status);
1085 1077 return -EPERM;
1086 1078 }
1087 1079  
1088 1080  
... ... @@ -1093,11 +1085,10 @@
1093 1085  
1094 1086 i = readmem(cosa, d.code, d.len, d.addr);
1095 1087 if (i < 0) {
1096   - printk(KERN_NOTICE "cosa%d: reading memory failed: %d\n",
1097   - cosa->num, i);
  1088 + pr_notice("cosa%d: reading memory failed: %d\n", cosa->num, i);
1098 1089 return -EIO;
1099 1090 }
1100   - printk(KERN_INFO "cosa%d: reading card memory - 0x%04x bytes at 0x%04x\n",
  1091 + pr_info("cosa%d: reading card memory - 0x%04x bytes at 0x%04x\n",
1101 1092 cosa->num, d.len, d.addr);
1102 1093 cosa->firmware_status |= COSA_FW_RESET;
1103 1094 return 0;
1104 1095  
1105 1096  
1106 1097  
... ... @@ -1109,23 +1100,22 @@
1109 1100 int i;
1110 1101  
1111 1102 if (cosa->usage > 1)
1112   - printk(KERN_INFO "cosa%d: WARNING: start microcode requested with cosa->usage > 1 (%d). Odd things may happen.\n",
  1103 + pr_info("cosa%d: WARNING: start microcode requested with cosa->usage > 1 (%d). Odd things may happen.\n",
1113 1104 cosa->num, cosa->usage);
1114 1105  
1115 1106 if ((cosa->firmware_status & (COSA_FW_RESET|COSA_FW_DOWNLOAD))
1116 1107 != (COSA_FW_RESET|COSA_FW_DOWNLOAD)) {
1117   - printk(KERN_NOTICE "%s: download the microcode and/or reset the card first (status %d).\n",
1118   - cosa->name, cosa->firmware_status);
  1108 + pr_notice("%s: download the microcode and/or reset the card first (status %d)\n",
  1109 + cosa->name, cosa->firmware_status);
1119 1110 return -EPERM;
1120 1111 }
1121 1112 cosa->firmware_status &= ~COSA_FW_RESET;
1122 1113 if ((i=startmicrocode(cosa, address)) < 0) {
1123   - printk(KERN_NOTICE "cosa%d: start microcode at 0x%04x failed: %d\n",
1124   - cosa->num, address, i);
  1114 + pr_notice("cosa%d: start microcode at 0x%04x failed: %d\n",
  1115 + cosa->num, address, i);
1125 1116 return -EIO;
1126 1117 }
1127   - printk(KERN_INFO "cosa%d: starting microcode at 0x%04x\n",
1128   - cosa->num, address);
  1118 + pr_info("cosa%d: starting microcode at 0x%04x\n", cosa->num, address);
1129 1119 cosa->startaddr = address;
1130 1120 cosa->firmware_status |= COSA_FW_START;
1131 1121 return 0;
1132 1122  
... ... @@ -1255,11 +1245,11 @@
1255 1245 #ifdef DEBUG_DATA
1256 1246 int i;
1257 1247  
1258   - printk(KERN_INFO "cosa%dc%d: starting tx(0x%x)", chan->cosa->num,
1259   - chan->num, len);
  1248 + pr_info("cosa%dc%d: starting tx(0x%x)",
  1249 + chan->cosa->num, chan->num, len);
1260 1250 for (i=0; i<len; i++)
1261   - printk(" %02x", buf[i]&0xff);
1262   - printk("\n");
  1251 + pr_cont(" %02x", buf[i]&0xff);
  1252 + pr_cont("\n");
1263 1253 #endif
1264 1254 spin_lock_irqsave(&cosa->lock, flags);
1265 1255 chan->txbuf = buf;
... ... @@ -1353,7 +1343,7 @@
1353 1343 if (test_bit(TXBIT, &cosa->rxtx))
1354 1344 s = "TX DMA";
1355 1345  
1356   - printk(KERN_INFO "%s: %s timeout - restarting.\n", cosa->name, s);
  1346 + pr_info("%s: %s timeout - restarting\n", cosa->name, s);
1357 1347 spin_lock_irqsave(&cosa->lock, flags);
1358 1348 cosa->rxtx = 0;
1359 1349  
... ... @@ -1387,7 +1377,7 @@
1387 1377 return 0;
1388 1378 if ((b^ (b+len)) & 0x10000) {
1389 1379 if (count++ < 5)
1390   - printk(KERN_INFO "%s: packet spanning a 64k boundary\n",
  1380 + pr_info("%s: packet spanning a 64k boundary\n",
1391 1381 chan->name);
1392 1382 return 0;
1393 1383 }
... ... @@ -1498,8 +1488,7 @@
1498 1488 char c;
1499 1489 int i;
1500 1490 if ((i=get_wait_data(cosa)) == -1) {
1501   - printk (KERN_INFO "cosa: 0x%04x bytes remaining\n",
1502   - length);
  1491 + pr_info("0x%04x bytes remaining\n", length);
1503 1492 return -11;
1504 1493 }
1505 1494 c=i;
1506 1495  
... ... @@ -1582,14 +1571,15 @@
1582 1571 short r;
1583 1572 r = cosa_getdata8(cosa);
1584 1573 #if 0
1585   - printk(KERN_INFO "cosa: get_wait_data returning after %d retries\n", 999-retries);
  1574 + pr_info("get_wait_data returning after %d retries\n",
  1575 + 999-retries);
1586 1576 #endif
1587 1577 return r;
1588 1578 }
1589 1579 /* sleep if not ready to read */
1590 1580 schedule_timeout_interruptible(1);
1591 1581 }
1592   - printk(KERN_INFO "cosa: timeout in get_wait_data (status 0x%x)\n",
  1582 + pr_info("timeout in get_wait_data (status 0x%x)\n",
1593 1583 cosa_getstatus(cosa));
1594 1584 return -1;
1595 1585 }
... ... @@ -1607,7 +1597,7 @@
1607 1597 if (cosa_getstatus(cosa) & SR_TX_RDY) {
1608 1598 cosa_putdata8(cosa, data);
1609 1599 #if 0
1610   - printk(KERN_INFO "Putdata: %d retries\n", 999-retries);
  1600 + pr_info("Putdata: %d retries\n", 999-retries);
1611 1601 #endif
1612 1602 return 0;
1613 1603 }
... ... @@ -1616,7 +1606,7 @@
1616 1606 schedule_timeout_interruptible(1);
1617 1607 #endif
1618 1608 }
1619   - printk(KERN_INFO "cosa%d: timeout in put_wait_data (status 0x%x)\n",
  1609 + pr_info("cosa%d: timeout in put_wait_data (status 0x%x)\n",
1620 1610 cosa->num, cosa_getstatus(cosa));
1621 1611 return -1;
1622 1612 }
1623 1613  
... ... @@ -1636,13 +1626,13 @@
1636 1626 sprintf(temp, "%04X", number);
1637 1627 for (i=0; i<4; i++) {
1638 1628 if (put_wait_data(cosa, temp[i]) == -1) {
1639   - printk(KERN_NOTICE "cosa%d: puthexnumber failed to write byte %d\n",
1640   - cosa->num, i);
  1629 + pr_notice("cosa%d: puthexnumber failed to write byte %d\n",
  1630 + cosa->num, i);
1641 1631 return -1-2*i;
1642 1632 }
1643 1633 if (get_wait_data(cosa) != temp[i]) {
1644   - printk(KERN_NOTICE "cosa%d: puthexhumber failed to read echo of byte %d\n",
1645   - cosa->num, i);
  1634 + pr_notice("cosa%d: puthexhumber failed to read echo of byte %d\n",
  1635 + cosa->num, i);
1646 1636 return -2-2*i;
1647 1637 }
1648 1638 }
... ... @@ -1687,8 +1677,7 @@
1687 1677 {
1688 1678 unsigned long flags, flags1;
1689 1679 #ifdef DEBUG_IRQS
1690   - printk(KERN_INFO "cosa%d: SR_DOWN_REQUEST status=0x%04x\n",
1691   - cosa->num, status);
  1680 + pr_info("cosa%d: SR_DOWN_REQUEST status=0x%04x\n", cosa->num, status);
1692 1681 #endif
1693 1682 spin_lock_irqsave(&cosa->lock, flags);
1694 1683 set_bit(TXBIT, &cosa->rxtx);
... ... @@ -1696,8 +1685,7 @@
1696 1685 /* flow control, see the comment above */
1697 1686 int i=0;
1698 1687 if (!cosa->txbitmap) {
1699   - printk(KERN_WARNING "%s: No channel wants data "
1700   - "in TX IRQ. Expect DMA timeout.",
  1688 + pr_warn("%s: No channel wants data in TX IRQ. Expect DMA timeout.\n",
1701 1689 cosa->name);
1702 1690 put_driver_status_nolock(cosa);
1703 1691 clear_bit(TXBIT, &cosa->rxtx);
1704 1692  
... ... @@ -1780,14 +1768,14 @@
1780 1768 if (cosa->busmaster) {
1781 1769 unsigned long addr = virt_to_bus(cosa->txbuf);
1782 1770 int count=0;
1783   - printk(KERN_INFO "busmaster IRQ\n");
  1771 + pr_info("busmaster IRQ\n");
1784 1772 while (!(cosa_getstatus(cosa)&SR_TX_RDY)) {
1785 1773 count++;
1786 1774 udelay(10);
1787 1775 if (count > 1000) break;
1788 1776 }
1789   - printk(KERN_INFO "status %x\n", cosa_getstatus(cosa));
1790   - printk(KERN_INFO "ready after %d loops\n", count);
  1777 + pr_info("status %x\n", cosa_getstatus(cosa));
  1778 + pr_info("ready after %d loops\n", count);
1791 1779 cosa_putdata16(cosa, (addr >> 16)&0xffff);
1792 1780  
1793 1781 count = 0;
... ... @@ -1796,7 +1784,7 @@
1796 1784 if (count > 1000) break;
1797 1785 udelay(10);
1798 1786 }
1799   - printk(KERN_INFO "ready after %d loops\n", count);
  1787 + pr_info("ready after %d loops\n", count);
1800 1788 cosa_putdata16(cosa, addr &0xffff);
1801 1789 flags1 = claim_dma_lock();
1802 1790 set_dma_mode(cosa->dma, DMA_MODE_CASCADE);
... ... @@ -1824,7 +1812,7 @@
1824 1812 {
1825 1813 unsigned long flags;
1826 1814 #ifdef DEBUG_IRQS
1827   - printk(KERN_INFO "cosa%d: SR_UP_REQUEST\n", cosa->num);
  1815 + pr_info("cosa%d: SR_UP_REQUEST\n", cosa->num);
1828 1816 #endif
1829 1817  
1830 1818 spin_lock_irqsave(&cosa->lock, flags);
... ... @@ -1847,7 +1835,7 @@
1847 1835 debug_data_in(cosa, cosa->rxsize & 0xff);
1848 1836 #endif
1849 1837 #if 0
1850   - printk(KERN_INFO "cosa%d: receive rxsize = (0x%04x).\n",
  1838 + pr_info("cosa%d: receive rxsize = (0x%04x)\n",
1851 1839 cosa->num, cosa->rxsize);
1852 1840 #endif
1853 1841 }
1854 1842  
... ... @@ -1857,12 +1845,12 @@
1857 1845 debug_data_in(cosa, cosa->rxsize);
1858 1846 #endif
1859 1847 #if 0
1860   - printk(KERN_INFO "cosa%d: receive rxsize = (0x%04x).\n",
  1848 + pr_info("cosa%d: receive rxsize = (0x%04x)\n",
1861 1849 cosa->num, cosa->rxsize);
1862 1850 #endif
1863 1851 }
1864 1852 if (((cosa->rxsize & 0xe000) >> 13) >= cosa->nchannels) {
1865   - printk(KERN_WARNING "%s: rx for unknown channel (0x%04x)\n",
  1853 + pr_warn("%s: rx for unknown channel (0x%04x)\n",
1866 1854 cosa->name, cosa->rxsize);
1867 1855 spin_unlock_irqrestore(&cosa->lock, flags);
1868 1856 goto reject;
... ... @@ -1877,7 +1865,7 @@
1877 1865  
1878 1866 if (!cosa->rxbuf) {
1879 1867 reject: /* Reject the packet */
1880   - printk(KERN_INFO "cosa%d: rejecting packet on channel %d\n",
  1868 + pr_info("cosa%d: rejecting packet on channel %d\n",
1881 1869 cosa->num, cosa->rxchan->num);
1882 1870 cosa->rxbuf = cosa->bouncebuf;
1883 1871 }
1884 1872  
... ... @@ -1924,11 +1912,11 @@
1924 1912 #ifdef DEBUG_DATA
1925 1913 {
1926 1914 int i;
1927   - printk(KERN_INFO "cosa%dc%d: done rx(0x%x)", cosa->num,
1928   - cosa->rxchan->num, cosa->rxsize);
  1915 + pr_info("cosa%dc%d: done rx(0x%x)",
  1916 + cosa->num, cosa->rxchan->num, cosa->rxsize);
1929 1917 for (i=0; i<cosa->rxsize; i++)
1930   - printk (" %02x", cosa->rxbuf[i]&0xff);
1931   - printk("\n");
  1918 + pr_cont(" %02x", cosa->rxbuf[i]&0xff);
  1919 + pr_cont("\n");
1932 1920 }
1933 1921 #endif
1934 1922 /* Packet for unknown channel? */
... ... @@ -1940,8 +1928,7 @@
1940 1928 if (cosa->rxchan->rx_done(cosa->rxchan))
1941 1929 clear_bit(cosa->rxchan->num, &cosa->rxbitmap);
1942 1930 } else {
1943   - printk(KERN_NOTICE "cosa%d: unexpected EOT interrupt\n",
1944   - cosa->num);
  1931 + pr_notice("cosa%d: unexpected EOT interrupt\n", cosa->num);
1945 1932 }
1946 1933 /*
1947 1934 * Clear the RXBIT, TXBIT and IRQBIT (the latest should be
... ... @@ -1963,8 +1950,7 @@
1963 1950 again:
1964 1951 status = cosa_getstatus(cosa);
1965 1952 #ifdef DEBUG_IRQS
1966   - printk(KERN_INFO "cosa%d: got IRQ, status 0x%02x\n", cosa->num,
1967   - status & 0xff);
  1953 + pr_info("cosa%d: got IRQ, status 0x%02x\n", cosa->num, status & 0xff);
1968 1954 #endif
1969 1955 #ifdef DEBUG_IO
1970 1956 debug_status_in(cosa, status);
1971 1957  
1972 1958  
... ... @@ -1985,15 +1971,15 @@
1985 1971 udelay(100);
1986 1972 goto again;
1987 1973 }
1988   - printk(KERN_INFO "cosa%d: unknown status 0x%02x in IRQ after %d retries\n",
  1974 + pr_info("cosa%d: unknown status 0x%02x in IRQ after %d retries\n",
1989 1975 cosa->num, status & 0xff, count);
1990 1976 }
1991 1977 #ifdef DEBUG_IRQS
1992 1978 if (count)
1993   - printk(KERN_INFO "%s: %d-times got unknown status in IRQ\n",
  1979 + pr_info("%s: %d-times got unknown status in IRQ\n",
1994 1980 cosa->name, count);
1995 1981 else
1996   - printk(KERN_INFO "%s: returning from IRQ\n", cosa->name);
  1982 + pr_info("%s: returning from IRQ\n", cosa->name);
1997 1983 #endif
1998 1984 return IRQ_HANDLED;
1999 1985 }
2000 1986  
2001 1987  
2002 1988  
2003 1989  
2004 1990  
2005 1991  
... ... @@ -2024,41 +2010,41 @@
2024 2010 s = "NO_REQ";
2025 2011 break;
2026 2012 }
2027   - printk(KERN_INFO "%s: IO: status -> 0x%02x (%s%s%s%s)\n",
  2013 + pr_info("%s: IO: status -> 0x%02x (%s%s%s%s)\n",
2028 2014 cosa->name,
2029 2015 status,
2030   - status & SR_USR_RQ ? "USR_RQ|":"",
2031   - status & SR_TX_RDY ? "TX_RDY|":"",
2032   - status & SR_RX_RDY ? "RX_RDY|":"",
  2016 + status & SR_USR_RQ ? "USR_RQ|" : "",
  2017 + status & SR_TX_RDY ? "TX_RDY|" : "",
  2018 + status & SR_RX_RDY ? "RX_RDY|" : "",
2033 2019 s);
2034 2020 }
2035 2021  
2036 2022 static void debug_status_out(struct cosa_data *cosa, int status)
2037 2023 {
2038   - printk(KERN_INFO "%s: IO: status <- 0x%02x (%s%s%s%s%s%s)\n",
  2024 + pr_info("%s: IO: status <- 0x%02x (%s%s%s%s%s%s)\n",
2039 2025 cosa->name,
2040 2026 status,
2041   - status & SR_RX_DMA_ENA ? "RXDMA|":"!rxdma|",
2042   - status & SR_TX_DMA_ENA ? "TXDMA|":"!txdma|",
2043   - status & SR_RST ? "RESET|":"",
2044   - status & SR_USR_INT_ENA ? "USRINT|":"!usrint|",
2045   - status & SR_TX_INT_ENA ? "TXINT|":"!txint|",
2046   - status & SR_RX_INT_ENA ? "RXINT":"!rxint");
  2027 + status & SR_RX_DMA_ENA ? "RXDMA|" : "!rxdma|",
  2028 + status & SR_TX_DMA_ENA ? "TXDMA|" : "!txdma|",
  2029 + status & SR_RST ? "RESET|" : "",
  2030 + status & SR_USR_INT_ENA ? "USRINT|" : "!usrint|",
  2031 + status & SR_TX_INT_ENA ? "TXINT|" : "!txint|",
  2032 + status & SR_RX_INT_ENA ? "RXINT" : "!rxint");
2047 2033 }
2048 2034  
2049 2035 static void debug_data_in(struct cosa_data *cosa, int data)
2050 2036 {
2051   - printk(KERN_INFO "%s: IO: data -> 0x%04x\n", cosa->name, data);
  2037 + pr_info("%s: IO: data -> 0x%04x\n", cosa->name, data);
2052 2038 }
2053 2039  
2054 2040 static void debug_data_out(struct cosa_data *cosa, int data)
2055 2041 {
2056   - printk(KERN_INFO "%s: IO: data <- 0x%04x\n", cosa->name, data);
  2042 + pr_info("%s: IO: data <- 0x%04x\n", cosa->name, data);
2057 2043 }
2058 2044  
2059 2045 static void debug_data_cmd(struct cosa_data *cosa, int data)
2060 2046 {
2061   - printk(KERN_INFO "%s: IO: data <- 0x%04x (%s|%s)\n",
  2047 + pr_info("%s: IO: data <- 0x%04x (%s|%s)\n",
2062 2048 cosa->name, data,
2063 2049 data & SR_RDY_RCV ? "RX_RDY" : "!rx_rdy",
2064 2050 data & SR_RDY_SND ? "TX_RDY" : "!tx_rdy");