Commit bbc2f23a authored by Finn Thain's avatar Finn Thain Committed by David S. Miller

net/sonic: Clean up and modernize log messages

Add missing printk severity levels by adopting pr_foo() calls for the
platform_driver and dev_foo() calls for the nubus_driver.
Avoid KERN_CONT usage as per advice from checkpatch.
Avoid #ifdef around printk calls.
Don't log driver probe messages after calling register_netdev().

Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Chris Zankel <chris@zankel.net>
Tested-by: default avatarStan Johnson <userm57@yahoo.com>
Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3d16bada
...@@ -142,17 +142,14 @@ static int sonic_probe1(struct net_device *dev) ...@@ -142,17 +142,14 @@ static int sonic_probe1(struct net_device *dev)
i++; i++;
if (known_revisions[i] == 0xffff) { if (known_revisions[i] == 0xffff) {
printk("SONIC ethernet controller not found (0x%4x)\n", pr_info("SONIC ethernet controller not found (0x%4x)\n",
silicon_revision); silicon_revision);
goto out; goto out;
} }
if (sonic_debug && version_printed++ == 0) if (sonic_debug && version_printed++ == 0)
printk(version); printk(version);
printk(KERN_INFO "%s: Sonic ethernet found at 0x%08lx, ",
dev_name(lp->device), dev->base_addr);
/* /*
* Put the sonic into software reset, then * Put the sonic into software reset, then
* retrieve and print the ethernet address. * retrieve and print the ethernet address.
...@@ -245,12 +242,14 @@ static int jazz_sonic_probe(struct platform_device *pdev) ...@@ -245,12 +242,14 @@ static int jazz_sonic_probe(struct platform_device *pdev)
err = sonic_probe1(dev); err = sonic_probe1(dev);
if (err) if (err)
goto out; goto out;
pr_info("SONIC ethernet @%08lx, MAC %pM, IRQ %d\n",
dev->base_addr, dev->dev_addr, dev->irq);
err = register_netdev(dev); err = register_netdev(dev);
if (err) if (err)
goto out1; goto out1;
printk("%s: MAC %pM IRQ %d\n", dev->name, dev->dev_addr, dev->irq);
return 0; return 0;
out1: out1:
......
...@@ -311,8 +311,6 @@ static int mac_onboard_sonic_probe(struct net_device *dev) ...@@ -311,8 +311,6 @@ static int mac_onboard_sonic_probe(struct net_device *dev)
int sr; int sr;
bool commslot = macintosh_config->expansion_type == MAC_EXP_PDS_COMM; bool commslot = macintosh_config->expansion_type == MAC_EXP_PDS_COMM;
printk(KERN_INFO "Checking for internal Macintosh ethernet (SONIC).. ");
/* Bogus probing, on the models which may or may not have /* Bogus probing, on the models which may or may not have
Ethernet (BTW, the Ethernet *is* always at the same Ethernet (BTW, the Ethernet *is* always at the same
address, and nothing else lives there, at least if Apple's address, and nothing else lives there, at least if Apple's
...@@ -322,13 +320,11 @@ static int mac_onboard_sonic_probe(struct net_device *dev) ...@@ -322,13 +320,11 @@ static int mac_onboard_sonic_probe(struct net_device *dev)
card_present = hwreg_present((void*)ONBOARD_SONIC_REGISTERS); card_present = hwreg_present((void*)ONBOARD_SONIC_REGISTERS);
if (!card_present) { if (!card_present) {
printk("none.\n"); pr_info("Onboard/comm-slot SONIC not found\n");
return -ENODEV; return -ENODEV;
} }
} }
printk("yes\n");
/* Danger! My arms are flailing wildly! You *must* set lp->reg_offset /* Danger! My arms are flailing wildly! You *must* set lp->reg_offset
* and dev->base_addr before using SONIC_READ() or SONIC_WRITE() */ * and dev->base_addr before using SONIC_READ() or SONIC_WRITE() */
dev->base_addr = ONBOARD_SONIC_REGISTERS; dev->base_addr = ONBOARD_SONIC_REGISTERS;
...@@ -341,14 +337,11 @@ static int mac_onboard_sonic_probe(struct net_device *dev) ...@@ -341,14 +337,11 @@ static int mac_onboard_sonic_probe(struct net_device *dev)
printk(KERN_INFO "%s", version); printk(KERN_INFO "%s", version);
sonic_version_printed = 1; sonic_version_printed = 1;
} }
printk(KERN_INFO "%s: onboard / comm-slot SONIC at 0x%08lx\n",
dev_name(lp->device), dev->base_addr);
/* The PowerBook's SONIC is 16 bit always. */ /* The PowerBook's SONIC is 16 bit always. */
if (macintosh_config->ident == MAC_MODEL_PB520) { if (macintosh_config->ident == MAC_MODEL_PB520) {
lp->reg_offset = 0; lp->reg_offset = 0;
lp->dma_bitmode = SONIC_BITMODE16; lp->dma_bitmode = SONIC_BITMODE16;
sr = SONIC_READ(SONIC_SR);
} else if (commslot) { } else if (commslot) {
/* Some of the comm-slot cards are 16 bit. But some /* Some of the comm-slot cards are 16 bit. But some
of them are not. The 32-bit cards use offset 2 and of them are not. The 32-bit cards use offset 2 and
...@@ -365,22 +358,21 @@ static int mac_onboard_sonic_probe(struct net_device *dev) ...@@ -365,22 +358,21 @@ static int mac_onboard_sonic_probe(struct net_device *dev)
else { else {
lp->dma_bitmode = SONIC_BITMODE16; lp->dma_bitmode = SONIC_BITMODE16;
lp->reg_offset = 0; lp->reg_offset = 0;
sr = SONIC_READ(SONIC_SR);
} }
} else { } else {
/* All onboard cards are at offset 2 with 32 bit DMA. */ /* All onboard cards are at offset 2 with 32 bit DMA. */
lp->reg_offset = 2; lp->reg_offset = 2;
lp->dma_bitmode = SONIC_BITMODE32; lp->dma_bitmode = SONIC_BITMODE32;
sr = SONIC_READ(SONIC_SR);
} }
printk(KERN_INFO
"%s: revision 0x%04x, using %d bit DMA and register offset %d\n",
dev_name(lp->device), sr, lp->dma_bitmode?32:16, lp->reg_offset);
#if 0 /* This is sometimes useful to find out how MacOS configured the card. */ pr_info("Onboard/comm-slot SONIC, revision 0x%04x, %d bit DMA, register offset %d\n",
printk(KERN_INFO "%s: DCR: 0x%04x, DCR2: 0x%04x\n", dev_name(lp->device), SONIC_READ(SONIC_SR), lp->dma_bitmode ? 32 : 16,
SONIC_READ(SONIC_DCR) & 0xffff, SONIC_READ(SONIC_DCR2) & 0xffff); lp->reg_offset);
#endif
/* This is sometimes useful to find out how MacOS configured the card */
pr_debug("%s: DCR=0x%04x, DCR2=0x%04x\n", __func__,
SONIC_READ(SONIC_DCR) & 0xffff,
SONIC_READ(SONIC_DCR2) & 0xffff);
/* Software reset, then initialize control registers. */ /* Software reset, then initialize control registers. */
SONIC_WRITE(SONIC_CMD, SONIC_CR_RST); SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
...@@ -401,6 +393,9 @@ static int mac_onboard_sonic_probe(struct net_device *dev) ...@@ -401,6 +393,9 @@ static int mac_onboard_sonic_probe(struct net_device *dev)
/* Now look for the MAC address. */ /* Now look for the MAC address. */
mac_onboard_sonic_ethernet_addr(dev); mac_onboard_sonic_ethernet_addr(dev);
pr_info("SONIC ethernet @%08lx, MAC %pM, IRQ %d\n",
dev->base_addr, dev->dev_addr, dev->irq);
/* Shared init code */ /* Shared init code */
return macsonic_init(dev); return macsonic_init(dev);
} }
...@@ -508,15 +503,15 @@ static int mac_sonic_nubus_probe_board(struct nubus_board *board, int id, ...@@ -508,15 +503,15 @@ static int mac_sonic_nubus_probe_board(struct nubus_board *board, int id,
printk(KERN_INFO "%s", version); printk(KERN_INFO "%s", version);
sonic_version_printed = 1; sonic_version_printed = 1;
} }
printk(KERN_INFO "%s: %s in slot %X\n",
dev_name(lp->device), board->name, board->slot); dev_info(&board->dev, "%s, revision 0x%04x, %d bit DMA, register offset %d\n",
printk(KERN_INFO "%s: revision 0x%04x, using %d bit DMA and register offset %d\n", board->name, SONIC_READ(SONIC_SR),
dev_name(lp->device), SONIC_READ(SONIC_SR), dma_bitmode?32:16, reg_offset); lp->dma_bitmode ? 32 : 16, lp->reg_offset);
#if 0 /* This is sometimes useful to find out how MacOS configured the card. */ /* This is sometimes useful to find out how MacOS configured the card */
printk(KERN_INFO "%s: DCR: 0x%04x, DCR2: 0x%04x\n", dev_name(lp->device), dev_dbg(&board->dev, "%s: DCR=0x%04x, DCR2=0x%04x\n", __func__,
SONIC_READ(SONIC_DCR) & 0xffff, SONIC_READ(SONIC_DCR2) & 0xffff); SONIC_READ(SONIC_DCR) & 0xffff,
#endif SONIC_READ(SONIC_DCR2) & 0xffff);
/* Software reset, then initialize control registers. */ /* Software reset, then initialize control registers. */
SONIC_WRITE(SONIC_CMD, SONIC_CR_RST); SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
...@@ -564,8 +559,6 @@ static int mac_sonic_platform_probe(struct platform_device *pdev) ...@@ -564,8 +559,6 @@ static int mac_sonic_platform_probe(struct platform_device *pdev)
if (err) if (err)
goto out; goto out;
printk("%s: MAC %pM IRQ %d\n", dev->name, dev->dev_addr, dev->irq);
return 0; return 0;
out: out:
......
...@@ -155,8 +155,8 @@ static int __init sonic_probe1(struct net_device *dev) ...@@ -155,8 +155,8 @@ static int __init sonic_probe1(struct net_device *dev)
i++; i++;
if (known_revisions[i] == 0xffff) { if (known_revisions[i] == 0xffff) {
printk("SONIC ethernet controller not found (0x%4x)\n", pr_info("SONIC ethernet controller not found (0x%4x)\n",
silicon_revision); silicon_revision);
return -ENODEV; return -ENODEV;
} }
...@@ -273,12 +273,13 @@ int xtsonic_probe(struct platform_device *pdev) ...@@ -273,12 +273,13 @@ int xtsonic_probe(struct platform_device *pdev)
if ((err = sonic_probe1(dev))) if ((err = sonic_probe1(dev)))
goto out; goto out;
pr_info("SONIC ethernet @%08lx, MAC %pM, IRQ %d\n",
dev->base_addr, dev->dev_addr, dev->irq);
if ((err = register_netdev(dev))) if ((err = register_netdev(dev)))
goto out1; goto out1;
printk("%s: SONIC ethernet @%08lx, MAC %pM, IRQ %d\n", dev->name,
dev->base_addr, dev->dev_addr, dev->irq);
return 0; return 0;
out1: out1:
......
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