Commit 2ad02bdc authored by Ben Boeckel's avatar Ben Boeckel Committed by David S. Miller

smc9194: replace printk with netdev_ calls

Also snipes some whitespace errors.
Signed-off-by: default avatarBen Boeckel <mathstuf@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b1a04a62
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
----------------------------------------------------------------------------*/ ----------------------------------------------------------------------------*/
static const char version[] = static const char version[] =
"smc9194.c:v0.14 12/15/00 by Erik Stahlman (erik@vt.edu)\n"; "smc9194.c:v0.14 12/15/00 by Erik Stahlman (erik@vt.edu)";
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -612,7 +612,7 @@ static void smc_hardware_send_packet( struct net_device * dev ) ...@@ -612,7 +612,7 @@ static void smc_hardware_send_packet( struct net_device * dev )
packet_no = inb( ioaddr + PNR_ARR + 1 ); packet_no = inb( ioaddr + PNR_ARR + 1 );
if ( packet_no & 0x80 ) { if ( packet_no & 0x80 ) {
/* or isn't there? BAD CHIP! */ /* or isn't there? BAD CHIP! */
printk(KERN_DEBUG CARDNAME": Memory allocation failed.\n"); netdev_dbg(dev, CARDNAME": Memory allocation failed.\n");
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
lp->saved_skb = NULL; lp->saved_skb = NULL;
netif_wake_queue(dev); netif_wake_queue(dev);
...@@ -625,7 +625,7 @@ static void smc_hardware_send_packet( struct net_device * dev ) ...@@ -625,7 +625,7 @@ static void smc_hardware_send_packet( struct net_device * dev )
/* point to the beginning of the packet */ /* point to the beginning of the packet */
outw( PTR_AUTOINC , ioaddr + POINTER ); outw( PTR_AUTOINC , ioaddr + POINTER );
PRINTK3((CARDNAME": Trying to xmit packet of length %x\n", length )); PRINTK3((CARDNAME": Trying to xmit packet of length %x\n", length));
#if SMC_DEBUG > 2 #if SMC_DEBUG > 2
print_packet( buf, length ); print_packet( buf, length );
#endif #endif
...@@ -865,7 +865,6 @@ static const struct net_device_ops smc_netdev_ops = { ...@@ -865,7 +865,6 @@ static const struct net_device_ops smc_netdev_ops = {
static int __init smc_probe(struct net_device *dev, int ioaddr) static int __init smc_probe(struct net_device *dev, int ioaddr)
{ {
int i, memory, retval; int i, memory, retval;
static unsigned version_printed;
unsigned int bank; unsigned int bank;
const char *version_string; const char *version_string;
...@@ -937,8 +936,7 @@ static int __init smc_probe(struct net_device *dev, int ioaddr) ...@@ -937,8 +936,7 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
It might be prudent to check a listing of MAC addresses It might be prudent to check a listing of MAC addresses
against the hardware address, or do some other tests. */ against the hardware address, or do some other tests. */
if (version_printed++ == 0) pr_info_once("%s\n", version);
printk("%s", version);
/* fill in some of the fields */ /* fill in some of the fields */
dev->base_addr = ioaddr; dev->base_addr = ioaddr;
...@@ -1027,21 +1025,21 @@ static int __init smc_probe(struct net_device *dev, int ioaddr) ...@@ -1027,21 +1025,21 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
/* now, print out the card info, in a short format.. */ /* now, print out the card info, in a short format.. */
printk("%s: %s(r:%d) at %#3x IRQ:%d INTF:%s MEM:%db ", dev->name, netdev_info(dev, "%s(r:%d) at %#3x IRQ:%d INTF:%s MEM:%db ",
version_string, revision_register & 0xF, ioaddr, dev->irq, version_string, revision_register & 0xF, ioaddr, dev->irq,
if_string, memory ); if_string, memory);
/* /*
. Print the Ethernet address . Print the Ethernet address
*/ */
printk("ADDR: %pM\n", dev->dev_addr); netdev_info(dev, "ADDR: %pM\n", dev->dev_addr);
/* Grab the IRQ */ /* Grab the IRQ */
retval = request_irq(dev->irq, smc_interrupt, 0, DRV_NAME, dev); retval = request_irq(dev->irq, smc_interrupt, 0, DRV_NAME, dev);
if (retval) { if (retval) {
printk("%s: unable to get IRQ %d (irqval=%d).\n", DRV_NAME, netdev_warn(dev, "%s: unable to get IRQ %d (irqval=%d).\n",
dev->irq, retval); DRV_NAME, dev->irq, retval);
goto err_out; goto err_out;
} }
dev->netdev_ops = &smc_netdev_ops; dev->netdev_ops = &smc_netdev_ops;
dev->watchdog_timeo = HZ/20; dev->watchdog_timeo = HZ/20;
...@@ -1061,30 +1059,32 @@ static void print_packet( byte * buf, int length ) ...@@ -1061,30 +1059,32 @@ static void print_packet( byte * buf, int length )
int remainder; int remainder;
int lines; int lines;
printk("Packet of length %d\n", length); pr_dbg("Packet of length %d\n", length);
lines = length / 16; lines = length / 16;
remainder = length % 16; remainder = length % 16;
for ( i = 0; i < lines ; i ++ ) { for ( i = 0; i < lines ; i ++ ) {
int cur; int cur;
printk(KERN_DEBUG);
for ( cur = 0; cur < 8; cur ++ ) { for ( cur = 0; cur < 8; cur ++ ) {
byte a, b; byte a, b;
a = *(buf ++ ); a = *(buf ++ );
b = *(buf ++ ); b = *(buf ++ );
printk("%02x%02x ", a, b ); pr_cont("%02x%02x ", a, b);
} }
printk("\n"); pr_cont("\n");
} }
printk(KERN_DEBUG);
for ( i = 0; i < remainder/2 ; i++ ) { for ( i = 0; i < remainder/2 ; i++ ) {
byte a, b; byte a, b;
a = *(buf ++ ); a = *(buf ++ );
b = *(buf ++ ); b = *(buf ++ );
printk("%02x%02x ", a, b ); pr_cont("%02x%02x ", a, b);
} }
printk("\n"); pr_cont("\n");
#endif #endif
} }
#endif #endif
...@@ -1151,9 +1151,8 @@ static void smc_timeout(struct net_device *dev) ...@@ -1151,9 +1151,8 @@ static void smc_timeout(struct net_device *dev)
{ {
/* If we get here, some higher level has decided we are broken. /* If we get here, some higher level has decided we are broken.
There should really be a "kick me" function call instead. */ There should really be a "kick me" function call instead. */
printk(KERN_WARNING CARDNAME": transmit timed out, %s?\n", netdev_warn(dev, CARDNAME": transmit timed out, %s?\n",
tx_done(dev) ? "IRQ conflict" : tx_done(dev) ? "IRQ conflict" : "network cable problem");
"network cable problem");
/* "kick" the adaptor */ /* "kick" the adaptor */
smc_reset( dev->base_addr ); smc_reset( dev->base_addr );
smc_enable( dev->base_addr ); smc_enable( dev->base_addr );
...@@ -1323,8 +1322,7 @@ static void smc_tx( struct net_device * dev ) ...@@ -1323,8 +1322,7 @@ static void smc_tx( struct net_device * dev )
dev->stats.tx_errors++; dev->stats.tx_errors++;
if ( tx_status & TS_LOSTCAR ) dev->stats.tx_carrier_errors++; if ( tx_status & TS_LOSTCAR ) dev->stats.tx_carrier_errors++;
if ( tx_status & TS_LATCOL ) { if ( tx_status & TS_LATCOL ) {
printk(KERN_DEBUG CARDNAME netdev_dbg(dev, CARDNAME": Late collision occurred on last xmit.\n");
": Late collision occurred on last xmit.\n");
dev->stats.tx_window_errors++; dev->stats.tx_window_errors++;
} }
#if 0 #if 0
...@@ -1332,7 +1330,7 @@ static void smc_tx( struct net_device * dev ) ...@@ -1332,7 +1330,7 @@ static void smc_tx( struct net_device * dev )
#endif #endif
if ( tx_status & TS_SUCCESS ) { if ( tx_status & TS_SUCCESS ) {
printk(CARDNAME": Successful packet caused interrupt\n"); netdev_info(dev, CARDNAME": Successful packet caused interrupt\n");
} }
/* re-enable transmit */ /* re-enable transmit */
SMC_SELECT_BANK( 0 ); SMC_SELECT_BANK( 0 );
......
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