aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <mathstuf@gmail.com>2013-11-01 08:53:34 -0400
committerDavid S. Miller <davem@davemloft.net>2013-11-02 01:19:25 -0400
commit2ad02bdc885db5b23a9f67aa43e682b586fba9cd (patch)
treea87f6000769999e5fc985f4dca5523520895caae
parentb1a04a62f31713610e156a0b9e4c677234916c2a (diff)
smc9194: replace printk with netdev_ calls
Also snipes some whitespace errors. Signed-off-by: Ben Boeckel <mathstuf@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/smsc/smc9194.c52
1 files changed, 25 insertions, 27 deletions
diff --git a/drivers/net/ethernet/smsc/smc9194.c b/drivers/net/ethernet/smsc/smc9194.c
index e85c2e7e8246..51aa9cf3a3e7 100644
--- a/drivers/net/ethernet/smsc/smc9194.c
+++ b/drivers/net/ethernet/smsc/smc9194.c
@@ -55,7 +55,7 @@
55 ----------------------------------------------------------------------------*/ 55 ----------------------------------------------------------------------------*/
56 56
57static const char version[] = 57static const char version[] =
58 "smc9194.c:v0.14 12/15/00 by Erik Stahlman (erik@vt.edu)\n"; 58 "smc9194.c:v0.14 12/15/00 by Erik Stahlman (erik@vt.edu)";
59 59
60#include <linux/module.h> 60#include <linux/module.h>
61#include <linux/kernel.h> 61#include <linux/kernel.h>
@@ -612,7 +612,7 @@ static void smc_hardware_send_packet( struct net_device * dev )
612 packet_no = inb( ioaddr + PNR_ARR + 1 ); 612 packet_no = inb( ioaddr + PNR_ARR + 1 );
613 if ( packet_no & 0x80 ) { 613 if ( packet_no & 0x80 ) {
614 /* or isn't there? BAD CHIP! */ 614 /* or isn't there? BAD CHIP! */
615 printk(KERN_DEBUG CARDNAME": Memory allocation failed.\n"); 615 netdev_dbg(dev, CARDNAME": Memory allocation failed.\n");
616 dev_kfree_skb_any(skb); 616 dev_kfree_skb_any(skb);
617 lp->saved_skb = NULL; 617 lp->saved_skb = NULL;
618 netif_wake_queue(dev); 618 netif_wake_queue(dev);
@@ -625,7 +625,7 @@ static void smc_hardware_send_packet( struct net_device * dev )
625 /* point to the beginning of the packet */ 625 /* point to the beginning of the packet */
626 outw( PTR_AUTOINC , ioaddr + POINTER ); 626 outw( PTR_AUTOINC , ioaddr + POINTER );
627 627
628 PRINTK3((CARDNAME": Trying to xmit packet of length %x\n", length )); 628 PRINTK3((CARDNAME": Trying to xmit packet of length %x\n", length));
629#if SMC_DEBUG > 2 629#if SMC_DEBUG > 2
630 print_packet( buf, length ); 630 print_packet( buf, length );
631#endif 631#endif
@@ -865,7 +865,6 @@ static const struct net_device_ops smc_netdev_ops = {
865static int __init smc_probe(struct net_device *dev, int ioaddr) 865static int __init smc_probe(struct net_device *dev, int ioaddr)
866{ 866{
867 int i, memory, retval; 867 int i, memory, retval;
868 static unsigned version_printed;
869 unsigned int bank; 868 unsigned int bank;
870 869
871 const char *version_string; 870 const char *version_string;
@@ -937,8 +936,7 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
937 It might be prudent to check a listing of MAC addresses 936 It might be prudent to check a listing of MAC addresses
938 against the hardware address, or do some other tests. */ 937 against the hardware address, or do some other tests. */
939 938
940 if (version_printed++ == 0) 939 pr_info_once("%s\n", version);
941 printk("%s", version);
942 940
943 /* fill in some of the fields */ 941 /* fill in some of the fields */
944 dev->base_addr = ioaddr; 942 dev->base_addr = ioaddr;
@@ -1027,21 +1025,21 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
1027 1025
1028 /* now, print out the card info, in a short format.. */ 1026 /* now, print out the card info, in a short format.. */
1029 1027
1030 printk("%s: %s(r:%d) at %#3x IRQ:%d INTF:%s MEM:%db ", dev->name, 1028 netdev_info(dev, "%s(r:%d) at %#3x IRQ:%d INTF:%s MEM:%db ",
1031 version_string, revision_register & 0xF, ioaddr, dev->irq, 1029 version_string, revision_register & 0xF, ioaddr, dev->irq,
1032 if_string, memory ); 1030 if_string, memory);
1033 /* 1031 /*
1034 . Print the Ethernet address 1032 . Print the Ethernet address
1035 */ 1033 */
1036 printk("ADDR: %pM\n", dev->dev_addr); 1034 netdev_info(dev, "ADDR: %pM\n", dev->dev_addr);
1037 1035
1038 /* Grab the IRQ */ 1036 /* Grab the IRQ */
1039 retval = request_irq(dev->irq, smc_interrupt, 0, DRV_NAME, dev); 1037 retval = request_irq(dev->irq, smc_interrupt, 0, DRV_NAME, dev);
1040 if (retval) { 1038 if (retval) {
1041 printk("%s: unable to get IRQ %d (irqval=%d).\n", DRV_NAME, 1039 netdev_warn(dev, "%s: unable to get IRQ %d (irqval=%d).\n",
1042 dev->irq, retval); 1040 DRV_NAME, dev->irq, retval);
1043 goto err_out; 1041 goto err_out;
1044 } 1042 }
1045 1043
1046 dev->netdev_ops = &smc_netdev_ops; 1044 dev->netdev_ops = &smc_netdev_ops;
1047 dev->watchdog_timeo = HZ/20; 1045 dev->watchdog_timeo = HZ/20;
@@ -1061,30 +1059,32 @@ static void print_packet( byte * buf, int length )
1061 int remainder; 1059 int remainder;
1062 int lines; 1060 int lines;
1063 1061
1064 printk("Packet of length %d\n", length); 1062 pr_dbg("Packet of length %d\n", length);
1065 lines = length / 16; 1063 lines = length / 16;
1066 remainder = length % 16; 1064 remainder = length % 16;
1067 1065
1068 for ( i = 0; i < lines ; i ++ ) { 1066 for ( i = 0; i < lines ; i ++ ) {
1069 int cur; 1067 int cur;
1070 1068
1069 printk(KERN_DEBUG);
1071 for ( cur = 0; cur < 8; cur ++ ) { 1070 for ( cur = 0; cur < 8; cur ++ ) {
1072 byte a, b; 1071 byte a, b;
1073 1072
1074 a = *(buf ++ ); 1073 a = *(buf ++ );
1075 b = *(buf ++ ); 1074 b = *(buf ++ );
1076 printk("%02x%02x ", a, b ); 1075 pr_cont("%02x%02x ", a, b);
1077 } 1076 }
1078 printk("\n"); 1077 pr_cont("\n");
1079 } 1078 }
1079 printk(KERN_DEBUG);
1080 for ( i = 0; i < remainder/2 ; i++ ) { 1080 for ( i = 0; i < remainder/2 ; i++ ) {
1081 byte a, b; 1081 byte a, b;
1082 1082
1083 a = *(buf ++ ); 1083 a = *(buf ++ );
1084 b = *(buf ++ ); 1084 b = *(buf ++ );
1085 printk("%02x%02x ", a, b ); 1085 pr_cont("%02x%02x ", a, b);
1086 } 1086 }
1087 printk("\n"); 1087 pr_cont("\n");
1088#endif 1088#endif
1089} 1089}
1090#endif 1090#endif
@@ -1151,9 +1151,8 @@ static void smc_timeout(struct net_device *dev)
1151{ 1151{
1152 /* If we get here, some higher level has decided we are broken. 1152 /* If we get here, some higher level has decided we are broken.
1153 There should really be a "kick me" function call instead. */ 1153 There should really be a "kick me" function call instead. */
1154 printk(KERN_WARNING CARDNAME": transmit timed out, %s?\n", 1154 netdev_warn(dev, CARDNAME": transmit timed out, %s?\n",
1155 tx_done(dev) ? "IRQ conflict" : 1155 tx_done(dev) ? "IRQ conflict" : "network cable problem");
1156 "network cable problem");
1157 /* "kick" the adaptor */ 1156 /* "kick" the adaptor */
1158 smc_reset( dev->base_addr ); 1157 smc_reset( dev->base_addr );
1159 smc_enable( dev->base_addr ); 1158 smc_enable( dev->base_addr );
@@ -1323,8 +1322,7 @@ static void smc_tx( struct net_device * dev )
1323 dev->stats.tx_errors++; 1322 dev->stats.tx_errors++;
1324 if ( tx_status & TS_LOSTCAR ) dev->stats.tx_carrier_errors++; 1323 if ( tx_status & TS_LOSTCAR ) dev->stats.tx_carrier_errors++;
1325 if ( tx_status & TS_LATCOL ) { 1324 if ( tx_status & TS_LATCOL ) {
1326 printk(KERN_DEBUG CARDNAME 1325 netdev_dbg(dev, CARDNAME": Late collision occurred on last xmit.\n");
1327 ": Late collision occurred on last xmit.\n");
1328 dev->stats.tx_window_errors++; 1326 dev->stats.tx_window_errors++;
1329 } 1327 }
1330#if 0 1328#if 0
@@ -1332,7 +1330,7 @@ static void smc_tx( struct net_device * dev )
1332#endif 1330#endif
1333 1331
1334 if ( tx_status & TS_SUCCESS ) { 1332 if ( tx_status & TS_SUCCESS ) {
1335 printk(CARDNAME": Successful packet caused interrupt\n"); 1333 netdev_info(dev, CARDNAME": Successful packet caused interrupt\n");
1336 } 1334 }
1337 /* re-enable transmit */ 1335 /* re-enable transmit */
1338 SMC_SELECT_BANK( 0 ); 1336 SMC_SELECT_BANK( 0 );