Skip to content

Commit 2ad02bd

Browse files
mathstufdavem330
authored andcommitted
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>
1 parent b1a04a6 commit 2ad02bd

File tree

1 file changed

+25
-27
lines changed

1 file changed

+25
-27
lines changed

drivers/net/ethernet/smsc/smc9194.c

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
----------------------------------------------------------------------------*/
5656

5757
static 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)";
5959

6060
#include <linux/module.h>
6161
#include <linux/kernel.h>
@@ -612,7 +612,7 @@ static void smc_hardware_send_packet( struct net_device * dev )
612612
packet_no = inb( ioaddr + PNR_ARR + 1 );
613613
if ( packet_no & 0x80 ) {
614614
/* or isn't there? BAD CHIP! */
615-
printk(KERN_DEBUG CARDNAME": Memory allocation failed.\n");
615+
netdev_dbg(dev, CARDNAME": Memory allocation failed.\n");
616616
dev_kfree_skb_any(skb);
617617
lp->saved_skb = NULL;
618618
netif_wake_queue(dev);
@@ -625,7 +625,7 @@ static void smc_hardware_send_packet( struct net_device * dev )
625625
/* point to the beginning of the packet */
626626
outw( PTR_AUTOINC , ioaddr + POINTER );
627627

628-
PRINTK3((CARDNAME": Trying to xmit packet of length %x\n", length ));
628+
PRINTK3((CARDNAME": Trying to xmit packet of length %x\n", length));
629629
#if SMC_DEBUG > 2
630630
print_packet( buf, length );
631631
#endif
@@ -865,7 +865,6 @@ static const struct net_device_ops smc_netdev_ops = {
865865
static int __init smc_probe(struct net_device *dev, int ioaddr)
866866
{
867867
int i, memory, retval;
868-
static unsigned version_printed;
869868
unsigned int bank;
870869

871870
const char *version_string;
@@ -937,8 +936,7 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
937936
It might be prudent to check a listing of MAC addresses
938937
against the hardware address, or do some other tests. */
939938

940-
if (version_printed++ == 0)
941-
printk("%s", version);
939+
pr_info_once("%s\n", version);
942940

943941
/* fill in some of the fields */
944942
dev->base_addr = ioaddr;
@@ -1027,21 +1025,21 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
10271025

10281026
/* now, print out the card info, in a short format.. */
10291027

1030-
printk("%s: %s(r:%d) at %#3x IRQ:%d INTF:%s MEM:%db ", dev->name,
1031-
version_string, revision_register & 0xF, ioaddr, dev->irq,
1032-
if_string, memory );
1028+
netdev_info(dev, "%s(r:%d) at %#3x IRQ:%d INTF:%s MEM:%db ",
1029+
version_string, revision_register & 0xF, ioaddr, dev->irq,
1030+
if_string, memory);
10331031
/*
10341032
. Print the Ethernet address
10351033
*/
1036-
printk("ADDR: %pM\n", dev->dev_addr);
1034+
netdev_info(dev, "ADDR: %pM\n", dev->dev_addr);
10371035

10381036
/* Grab the IRQ */
1039-
retval = request_irq(dev->irq, smc_interrupt, 0, DRV_NAME, dev);
1040-
if (retval) {
1041-
printk("%s: unable to get IRQ %d (irqval=%d).\n", DRV_NAME,
1042-
dev->irq, retval);
1043-
goto err_out;
1044-
}
1037+
retval = request_irq(dev->irq, smc_interrupt, 0, DRV_NAME, dev);
1038+
if (retval) {
1039+
netdev_warn(dev, "%s: unable to get IRQ %d (irqval=%d).\n",
1040+
DRV_NAME, dev->irq, retval);
1041+
goto err_out;
1042+
}
10451043

10461044
dev->netdev_ops = &smc_netdev_ops;
10471045
dev->watchdog_timeo = HZ/20;
@@ -1061,30 +1059,32 @@ static void print_packet( byte * buf, int length )
10611059
int remainder;
10621060
int lines;
10631061

1064-
printk("Packet of length %d\n", length);
1062+
pr_dbg("Packet of length %d\n", length);
10651063
lines = length / 16;
10661064
remainder = length % 16;
10671065

10681066
for ( i = 0; i < lines ; i ++ ) {
10691067
int cur;
10701068

1069+
printk(KERN_DEBUG);
10711070
for ( cur = 0; cur < 8; cur ++ ) {
10721071
byte a, b;
10731072

10741073
a = *(buf ++ );
10751074
b = *(buf ++ );
1076-
printk("%02x%02x ", a, b );
1075+
pr_cont("%02x%02x ", a, b);
10771076
}
1078-
printk("\n");
1077+
pr_cont("\n");
10791078
}
1079+
printk(KERN_DEBUG);
10801080
for ( i = 0; i < remainder/2 ; i++ ) {
10811081
byte a, b;
10821082

10831083
a = *(buf ++ );
10841084
b = *(buf ++ );
1085-
printk("%02x%02x ", a, b );
1085+
pr_cont("%02x%02x ", a, b);
10861086
}
1087-
printk("\n");
1087+
pr_cont("\n");
10881088
#endif
10891089
}
10901090
#endif
@@ -1151,9 +1151,8 @@ static void smc_timeout(struct net_device *dev)
11511151
{
11521152
/* If we get here, some higher level has decided we are broken.
11531153
There should really be a "kick me" function call instead. */
1154-
printk(KERN_WARNING CARDNAME": transmit timed out, %s?\n",
1155-
tx_done(dev) ? "IRQ conflict" :
1156-
"network cable problem");
1154+
netdev_warn(dev, CARDNAME": transmit timed out, %s?\n",
1155+
tx_done(dev) ? "IRQ conflict" : "network cable problem");
11571156
/* "kick" the adaptor */
11581157
smc_reset( dev->base_addr );
11591158
smc_enable( dev->base_addr );
@@ -1323,16 +1322,15 @@ static void smc_tx( struct net_device * dev )
13231322
dev->stats.tx_errors++;
13241323
if ( tx_status & TS_LOSTCAR ) dev->stats.tx_carrier_errors++;
13251324
if ( tx_status & TS_LATCOL ) {
1326-
printk(KERN_DEBUG CARDNAME
1327-
": Late collision occurred on last xmit.\n");
1325+
netdev_dbg(dev, CARDNAME": Late collision occurred on last xmit.\n");
13281326
dev->stats.tx_window_errors++;
13291327
}
13301328
#if 0
13311329
if ( tx_status & TS_16COL ) { ... }
13321330
#endif
13331331

13341332
if ( tx_status & TS_SUCCESS ) {
1335-
printk(CARDNAME": Successful packet caused interrupt\n");
1333+
netdev_info(dev, CARDNAME": Successful packet caused interrupt\n");
13361334
}
13371335
/* re-enable transmit */
13381336
SMC_SELECT_BANK( 0 );

0 commit comments

Comments
 (0)