diff options
author | Alexander Beregalov <a.beregalov@gmail.com> | 2009-05-26 08:35:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-26 23:35:02 -0400 |
commit | 646cdb32831eebe8c2f742c293d0d266326854d9 (patch) | |
tree | 43b2460ea3704f2b6e1ff0c53cc592ecaa4d3747 /drivers/net/3c501.c | |
parent | d3f65f7c3cf11b036bbc01f22ac5c958570e724c (diff) |
3c50x: convert printk() to pr_<foo>()
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/3c501.c')
-rw-r--r-- | drivers/net/3c501.c | 65 |
1 files changed, 29 insertions, 36 deletions
diff --git a/drivers/net/3c501.c b/drivers/net/3c501.c index 1c5344aa57cc..367bec63620c 100644 --- a/drivers/net/3c501.c +++ b/drivers/net/3c501.c | |||
@@ -281,7 +281,7 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr) | |||
281 | autoirq = probe_irq_off(irq_mask); | 281 | autoirq = probe_irq_off(irq_mask); |
282 | 282 | ||
283 | if (autoirq == 0) { | 283 | if (autoirq == 0) { |
284 | printk(KERN_WARNING "%s probe at %#x failed to detect IRQ line.\n", | 284 | pr_warning("%s probe at %#x failed to detect IRQ line.\n", |
285 | mname, ioaddr); | 285 | mname, ioaddr); |
286 | release_region(ioaddr, EL1_IO_EXTENT); | 286 | release_region(ioaddr, EL1_IO_EXTENT); |
287 | return -EAGAIN; | 287 | return -EAGAIN; |
@@ -297,16 +297,16 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr) | |||
297 | if (autoirq) | 297 | if (autoirq) |
298 | dev->irq = autoirq; | 298 | dev->irq = autoirq; |
299 | 299 | ||
300 | printk(KERN_INFO "%s: %s EtherLink at %#lx, using %sIRQ %d.\n", | 300 | pr_info("%s: %s EtherLink at %#lx, using %sIRQ %d.\n", |
301 | dev->name, mname, dev->base_addr, | 301 | dev->name, mname, dev->base_addr, |
302 | autoirq ? "auto":"assigned ", dev->irq); | 302 | autoirq ? "auto":"assigned ", dev->irq); |
303 | 303 | ||
304 | #ifdef CONFIG_IP_MULTICAST | 304 | #ifdef CONFIG_IP_MULTICAST |
305 | printk(KERN_WARNING "WARNING: Use of the 3c501 in a multicast kernel is NOT recommended.\n"); | 305 | pr_warning("WARNING: Use of the 3c501 in a multicast kernel is NOT recommended.\n"); |
306 | #endif | 306 | #endif |
307 | 307 | ||
308 | if (el_debug) | 308 | if (el_debug) |
309 | printk(KERN_DEBUG "%s", version); | 309 | pr_debug("%s", version); |
310 | 310 | ||
311 | lp = netdev_priv(dev); | 311 | lp = netdev_priv(dev); |
312 | memset(lp, 0, sizeof(struct net_local)); | 312 | memset(lp, 0, sizeof(struct net_local)); |
@@ -343,7 +343,7 @@ static int el_open(struct net_device *dev) | |||
343 | unsigned long flags; | 343 | unsigned long flags; |
344 | 344 | ||
345 | if (el_debug > 2) | 345 | if (el_debug > 2) |
346 | printk(KERN_DEBUG "%s: Doing el_open()...", dev->name); | 346 | pr_debug("%s: Doing el_open()...\n", dev->name); |
347 | 347 | ||
348 | retval = request_irq(dev->irq, &el_interrupt, 0, dev->name, dev); | 348 | retval = request_irq(dev->irq, &el_interrupt, 0, dev->name, dev); |
349 | if (retval) | 349 | if (retval) |
@@ -374,7 +374,7 @@ static void el_timeout(struct net_device *dev) | |||
374 | int ioaddr = dev->base_addr; | 374 | int ioaddr = dev->base_addr; |
375 | 375 | ||
376 | if (el_debug) | 376 | if (el_debug) |
377 | printk(KERN_DEBUG "%s: transmit timed out, txsr %#2x axsr=%02x rxsr=%02x.\n", | 377 | pr_debug("%s: transmit timed out, txsr %#2x axsr=%02x rxsr=%02x.\n", |
378 | dev->name, inb(TX_STATUS), | 378 | dev->name, inb(TX_STATUS), |
379 | inb(AX_STATUS), inb(RX_STATUS)); | 379 | inb(AX_STATUS), inb(RX_STATUS)); |
380 | dev->stats.tx_errors++; | 380 | dev->stats.tx_errors++; |
@@ -483,14 +483,13 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
483 | lp->loading = 0; | 483 | lp->loading = 0; |
484 | dev->trans_start = jiffies; | 484 | dev->trans_start = jiffies; |
485 | if (el_debug > 2) | 485 | if (el_debug > 2) |
486 | printk(KERN_DEBUG " queued xmit.\n"); | 486 | pr_debug(" queued xmit.\n"); |
487 | dev_kfree_skb(skb); | 487 | dev_kfree_skb(skb); |
488 | return 0; | 488 | return 0; |
489 | } | 489 | } |
490 | /* A receive upset our load, despite our best efforts */ | 490 | /* A receive upset our load, despite our best efforts */ |
491 | if (el_debug > 2) | 491 | if (el_debug > 2) |
492 | printk(KERN_DEBUG "%s: burped during tx load.\n", | 492 | pr_debug("%s: burped during tx load.\n", dev->name); |
493 | dev->name); | ||
494 | spin_lock_irqsave(&lp->lock, flags); | 493 | spin_lock_irqsave(&lp->lock, flags); |
495 | } while (1); | 494 | } while (1); |
496 | } | 495 | } |
@@ -540,11 +539,10 @@ static irqreturn_t el_interrupt(int irq, void *dev_id) | |||
540 | */ | 539 | */ |
541 | 540 | ||
542 | if (el_debug > 3) | 541 | if (el_debug > 3) |
543 | printk(KERN_DEBUG "%s: el_interrupt() aux=%#02x", | 542 | pr_debug("%s: el_interrupt() aux=%#02x\n", dev->name, axsr); |
544 | dev->name, axsr); | ||
545 | 543 | ||
546 | if (lp->loading == 1 && !lp->txing) | 544 | if (lp->loading == 1 && !lp->txing) |
547 | printk(KERN_WARNING "%s: Inconsistent state loading while not in tx\n", | 545 | pr_warning("%s: Inconsistent state loading while not in tx\n", |
548 | dev->name); | 546 | dev->name); |
549 | 547 | ||
550 | if (lp->txing) { | 548 | if (lp->txing) { |
@@ -555,19 +553,17 @@ static irqreturn_t el_interrupt(int irq, void *dev_id) | |||
555 | int txsr = inb(TX_STATUS); | 553 | int txsr = inb(TX_STATUS); |
556 | 554 | ||
557 | if (lp->loading == 1) { | 555 | if (lp->loading == 1) { |
558 | if (el_debug > 2) { | 556 | if (el_debug > 2) |
559 | printk(KERN_DEBUG "%s: Interrupt while loading [", | 557 | pr_debug("%s: Interrupt while loading [txsr=%02x gp=%04x rp=%04x]\n", |
560 | dev->name); | 558 | dev->name, txsr, inw(GP_LOW), inw(RX_LOW)); |
561 | printk(" txsr=%02x gp=%04x rp=%04x]\n", | 559 | |
562 | txsr, inw(GP_LOW), inw(RX_LOW)); | ||
563 | } | ||
564 | /* Force a reload */ | 560 | /* Force a reload */ |
565 | lp->loading = 2; | 561 | lp->loading = 2; |
566 | spin_unlock(&lp->lock); | 562 | spin_unlock(&lp->lock); |
567 | goto out; | 563 | goto out; |
568 | } | 564 | } |
569 | if (el_debug > 6) | 565 | if (el_debug > 6) |
570 | printk(KERN_DEBUG " txsr=%02x gp=%04x rp=%04x", | 566 | pr_debug("%s: txsr=%02x gp=%04x rp=%04x\n", dev->name, |
571 | txsr, inw(GP_LOW), inw(RX_LOW)); | 567 | txsr, inw(GP_LOW), inw(RX_LOW)); |
572 | 568 | ||
573 | if ((axsr & 0x80) && (txsr & TX_READY) == 0) { | 569 | if ((axsr & 0x80) && (txsr & TX_READY) == 0) { |
@@ -576,7 +572,7 @@ static irqreturn_t el_interrupt(int irq, void *dev_id) | |||
576 | * on trying or reset immediately ? | 572 | * on trying or reset immediately ? |
577 | */ | 573 | */ |
578 | if (el_debug > 1) | 574 | if (el_debug > 1) |
579 | printk(KERN_DEBUG "%s: Unusual interrupt during Tx, txsr=%02x axsr=%02x gp=%03x rp=%03x.\n", | 575 | pr_debug("%s: Unusual interrupt during Tx, txsr=%02x axsr=%02x gp=%03x rp=%03x.\n", |
580 | dev->name, txsr, axsr, | 576 | dev->name, txsr, axsr, |
581 | inw(ioaddr + EL1_DATAPTR), | 577 | inw(ioaddr + EL1_DATAPTR), |
582 | inw(ioaddr + EL1_RXPTR)); | 578 | inw(ioaddr + EL1_RXPTR)); |
@@ -587,7 +583,7 @@ static irqreturn_t el_interrupt(int irq, void *dev_id) | |||
587 | * Timed out | 583 | * Timed out |
588 | */ | 584 | */ |
589 | if (el_debug) | 585 | if (el_debug) |
590 | printk(KERN_DEBUG "%s: Transmit failed 16 times, Ethernet jammed?\n", dev->name); | 586 | pr_debug("%s: Transmit failed 16 times, Ethernet jammed?\n", dev->name); |
591 | outb(AX_SYS, AX_CMD); | 587 | outb(AX_SYS, AX_CMD); |
592 | lp->txing = 0; | 588 | lp->txing = 0; |
593 | dev->stats.tx_aborted_errors++; | 589 | dev->stats.tx_aborted_errors++; |
@@ -598,7 +594,7 @@ static irqreturn_t el_interrupt(int irq, void *dev_id) | |||
598 | */ | 594 | */ |
599 | 595 | ||
600 | if (el_debug > 6) | 596 | if (el_debug > 6) |
601 | printk(KERN_DEBUG " retransmitting after a collision.\n"); | 597 | pr_debug("%s: retransmitting after a collision.\n", dev->name); |
602 | /* | 598 | /* |
603 | * Poor little chip can't reset its own start | 599 | * Poor little chip can't reset its own start |
604 | * pointer | 600 | * pointer |
@@ -616,9 +612,8 @@ static irqreturn_t el_interrupt(int irq, void *dev_id) | |||
616 | */ | 612 | */ |
617 | dev->stats.tx_packets++; | 613 | dev->stats.tx_packets++; |
618 | if (el_debug > 6) | 614 | if (el_debug > 6) |
619 | printk(KERN_DEBUG " Tx succeeded %s\n", | 615 | pr_debug("%s: Tx succeeded %s\n", dev->name, |
620 | (txsr & TX_RDY) ? "." : | 616 | (txsr & TX_RDY) ? "." : "but tx is busy!"); |
621 | "but tx is busy!"); | ||
622 | /* | 617 | /* |
623 | * This is safe the interrupt is atomic WRT itself. | 618 | * This is safe the interrupt is atomic WRT itself. |
624 | */ | 619 | */ |
@@ -633,7 +628,8 @@ static irqreturn_t el_interrupt(int irq, void *dev_id) | |||
633 | 628 | ||
634 | int rxsr = inb(RX_STATUS); | 629 | int rxsr = inb(RX_STATUS); |
635 | if (el_debug > 5) | 630 | if (el_debug > 5) |
636 | printk(KERN_DEBUG " rxsr=%02x txsr=%02x rp=%04x", rxsr, inb(TX_STATUS), inw(RX_LOW)); | 631 | pr_debug("%s: rxsr=%02x txsr=%02x rp=%04x\n", |
632 | dev->name, rxsr, inb(TX_STATUS), inw(RX_LOW)); | ||
637 | /* | 633 | /* |
638 | * Just reading rx_status fixes most errors. | 634 | * Just reading rx_status fixes most errors. |
639 | */ | 635 | */ |
@@ -643,7 +639,7 @@ static irqreturn_t el_interrupt(int irq, void *dev_id) | |||
643 | /* Handled to avoid board lock-up. */ | 639 | /* Handled to avoid board lock-up. */ |
644 | dev->stats.rx_length_errors++; | 640 | dev->stats.rx_length_errors++; |
645 | if (el_debug > 5) | 641 | if (el_debug > 5) |
646 | printk(KERN_DEBUG " runt.\n"); | 642 | pr_debug("%s: runt.\n", dev->name); |
647 | } else if (rxsr & RX_GOOD) { | 643 | } else if (rxsr & RX_GOOD) { |
648 | /* | 644 | /* |
649 | * Receive worked. | 645 | * Receive worked. |
@@ -654,12 +650,10 @@ static irqreturn_t el_interrupt(int irq, void *dev_id) | |||
654 | * Nothing? Something is broken! | 650 | * Nothing? Something is broken! |
655 | */ | 651 | */ |
656 | if (el_debug > 2) | 652 | if (el_debug > 2) |
657 | printk(KERN_DEBUG "%s: No packet seen, rxsr=%02x **resetting 3c501***\n", | 653 | pr_debug("%s: No packet seen, rxsr=%02x **resetting 3c501***\n", |
658 | dev->name, rxsr); | 654 | dev->name, rxsr); |
659 | el_reset(dev); | 655 | el_reset(dev); |
660 | } | 656 | } |
661 | if (el_debug > 3) | ||
662 | printk(KERN_DEBUG ".\n"); | ||
663 | } | 657 | } |
664 | 658 | ||
665 | /* | 659 | /* |
@@ -695,11 +689,11 @@ static void el_receive(struct net_device *dev) | |||
695 | pkt_len = inw(RX_LOW); | 689 | pkt_len = inw(RX_LOW); |
696 | 690 | ||
697 | if (el_debug > 4) | 691 | if (el_debug > 4) |
698 | printk(KERN_DEBUG " el_receive %d.\n", pkt_len); | 692 | pr_debug(" el_receive %d.\n", pkt_len); |
699 | 693 | ||
700 | if (pkt_len < 60 || pkt_len > 1536) { | 694 | if (pkt_len < 60 || pkt_len > 1536) { |
701 | if (el_debug) | 695 | if (el_debug) |
702 | printk(KERN_DEBUG "%s: bogus packet, length=%d\n", | 696 | pr_debug("%s: bogus packet, length=%d\n", |
703 | dev->name, pkt_len); | 697 | dev->name, pkt_len); |
704 | dev->stats.rx_over_errors++; | 698 | dev->stats.rx_over_errors++; |
705 | return; | 699 | return; |
@@ -718,8 +712,7 @@ static void el_receive(struct net_device *dev) | |||
718 | 712 | ||
719 | outw(0x00, GP_LOW); | 713 | outw(0x00, GP_LOW); |
720 | if (skb == NULL) { | 714 | if (skb == NULL) { |
721 | printk(KERN_INFO "%s: Memory squeeze, dropping packet.\n", | 715 | pr_info("%s: Memory squeeze, dropping packet.\n", dev->name); |
722 | dev->name); | ||
723 | dev->stats.rx_dropped++; | 716 | dev->stats.rx_dropped++; |
724 | return; | 717 | return; |
725 | } else { | 718 | } else { |
@@ -753,7 +746,7 @@ static void el_reset(struct net_device *dev) | |||
753 | int ioaddr = dev->base_addr; | 746 | int ioaddr = dev->base_addr; |
754 | 747 | ||
755 | if (el_debug > 2) | 748 | if (el_debug > 2) |
756 | printk(KERN_INFO "3c501 reset..."); | 749 | pr_info("3c501 reset...\n"); |
757 | outb(AX_RESET, AX_CMD); /* Reset the chip */ | 750 | outb(AX_RESET, AX_CMD); /* Reset the chip */ |
758 | /* Aux control, irq and loopback enabled */ | 751 | /* Aux control, irq and loopback enabled */ |
759 | outb(AX_LOOP, AX_CMD); | 752 | outb(AX_LOOP, AX_CMD); |
@@ -787,7 +780,7 @@ static int el1_close(struct net_device *dev) | |||
787 | int ioaddr = dev->base_addr; | 780 | int ioaddr = dev->base_addr; |
788 | 781 | ||
789 | if (el_debug > 2) | 782 | if (el_debug > 2) |
790 | printk(KERN_INFO "%s: Shutting down Ethernet card at %#x.\n", | 783 | pr_info("%s: Shutting down Ethernet card at %#x.\n", |
791 | dev->name, ioaddr); | 784 | dev->name, ioaddr); |
792 | 785 | ||
793 | netif_stop_queue(dev); | 786 | netif_stop_queue(dev); |