mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Finn Thain <fthain@telegraphics.com.au>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Chris Zankel <chris@zankel.net>
Subject: [PATCH RESEND net 6/9] net/sonic: Cleanup and modernize log messages
Date: Mon,  2 Oct 2017 21:07:18 -0400 (EDT)	[thread overview]
Message-ID: <8cbb2a69ee53d6ab49c8bc48864fdf3c397a52f5.1506992619.git.fthain@telegraphics.com.au> (raw)
In-Reply-To: <cover.1506992619.git.fthain@telegraphics.com.au>

Add missing printk severity levels.
Don't print the valid silicon revision number (it's in the source).
Avoid KERN_CONT usage as per advice from checkpatch.
Avoid ifdef around printk calls.

Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Chris Zankel <chris@zankel.net>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
---
 drivers/net/ethernet/natsemi/jazzsonic.c |  9 +++------
 drivers/net/ethernet/natsemi/macsonic.c  | 24 ++++++++++--------------
 drivers/net/ethernet/natsemi/xtsonic.c   | 11 ++++-------
 3 files changed, 17 insertions(+), 27 deletions(-)

diff --git a/drivers/net/ethernet/natsemi/jazzsonic.c b/drivers/net/ethernet/natsemi/jazzsonic.c
index a6caeb567c0d..6ec25c27cb73 100644
--- a/drivers/net/ethernet/natsemi/jazzsonic.c
+++ b/drivers/net/ethernet/natsemi/jazzsonic.c
@@ -132,17 +132,14 @@ static int sonic_probe1(struct net_device *dev)
 	 * the expected location.
 	 */
 	silicon_revision = SONIC_READ(SONIC_SR);
-	if (sonic_debug > 1)
-		printk("SONIC Silicon Revision = 0x%04x\n",silicon_revision);
-
 	i = 0;
 	while (known_revisions[i] != 0xffff &&
 	       known_revisions[i] != silicon_revision)
 		i++;
 
 	if (known_revisions[i] == 0xffff) {
-		printk("SONIC ethernet controller not found (0x%4x)\n",
-		       silicon_revision);
+		pr_info("SONIC ethernet controller not found (0x%4x)\n",
+		        silicon_revision);
 		goto out;
 	}
 
@@ -248,7 +245,7 @@ static int jazz_sonic_probe(struct platform_device *pdev)
 	if (err)
 		goto out1;
 
-	printk("%s: MAC %pM IRQ %d\n", dev->name, dev->dev_addr, dev->irq);
+	netdev_info(dev, "MAC %pM, IRQ %d\n", dev->dev_addr, dev->irq);
 
 	return 0;
 
diff --git a/drivers/net/ethernet/natsemi/macsonic.c b/drivers/net/ethernet/natsemi/macsonic.c
index 3ca6ae7caf55..795d71522617 100644
--- a/drivers/net/ethernet/natsemi/macsonic.c
+++ b/drivers/net/ethernet/natsemi/macsonic.c
@@ -315,8 +315,6 @@ static int mac_onboard_sonic_probe(struct net_device *dev)
 	if (!MACH_IS_MAC)
 		return -ENODEV;
 
-	printk(KERN_INFO "Checking for internal Macintosh ethernet (SONIC).. ");
-
 	/* Bogus probing, on the models which may or may not have
 	   Ethernet (BTW, the Ethernet *is* always at the same
 	   address, and nothing else lives there, at least if Apple's
@@ -329,14 +327,12 @@ static int mac_onboard_sonic_probe(struct net_device *dev)
 
 		card_present = hwreg_present((void*)ONBOARD_SONIC_REGISTERS);
 		if (!card_present) {
-			printk("none.\n");
+			pr_info("No onboard or comm-slot SONIC was detected\n");
 			return -ENODEV;
 		}
 		commslot = 1;
 	}
 
-	printk("yes\n");
-
 	/* Danger!  My arms are flailing wildly!  You *must* set lp->reg_offset
 	 * and dev->base_addr before using SONIC_READ() or SONIC_WRITE() */
 	dev->base_addr = ONBOARD_SONIC_REGISTERS;
@@ -385,10 +381,10 @@ static int mac_onboard_sonic_probe(struct net_device *dev)
 	       "%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. */
-	printk(KERN_INFO "%s: DCR: 0x%04x, DCR2: 0x%04x\n", dev_name(lp->device),
-	       SONIC_READ(SONIC_DCR) & 0xffff, SONIC_READ(SONIC_DCR2) & 0xffff);
-#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. */
 	SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
@@ -540,10 +536,10 @@ static int mac_nubus_sonic_probe(struct net_device *dev)
 	printk(KERN_INFO "%s: revision 0x%04x, using %d bit DMA and register offset %d\n",
 	       dev_name(lp->device), SONIC_READ(SONIC_SR), dma_bitmode?32:16, reg_offset);
 
-#if 0 /* 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),
-	       SONIC_READ(SONIC_DCR) & 0xffff, SONIC_READ(SONIC_DCR2) & 0xffff);
-#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. */
 	SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
@@ -594,7 +590,7 @@ static int mac_sonic_probe(struct platform_device *pdev)
 	if (err)
 		goto out;
 
-	printk("%s: MAC %pM IRQ %d\n", dev->name, dev->dev_addr, dev->irq);
+	netdev_info(dev, "MAC %pM, IRQ %d\n", dev->dev_addr, dev->irq);
 
 	return 0;
 
diff --git a/drivers/net/ethernet/natsemi/xtsonic.c b/drivers/net/ethernet/natsemi/xtsonic.c
index 9ee0f69a83c0..bed89e8105e9 100644
--- a/drivers/net/ethernet/natsemi/xtsonic.c
+++ b/drivers/net/ethernet/natsemi/xtsonic.c
@@ -145,17 +145,14 @@ static int __init sonic_probe1(struct net_device *dev)
 	 * the expected location.
 	 */
 	silicon_revision = SONIC_READ(SONIC_SR);
-	if (sonic_debug > 1)
-		printk("SONIC Silicon Revision = 0x%04x\n",silicon_revision);
-
 	i = 0;
 	while ((known_revisions[i] != 0xffff) &&
 			(known_revisions[i] != silicon_revision))
 		i++;
 
 	if (known_revisions[i] == 0xffff) {
-		printk("SONIC ethernet controller not found (0x%4x)\n",
-				silicon_revision);
+		pr_info("SONIC ethernet controller not found (0x%4x)\n",
+		        silicon_revision);
 		return -ENODEV;
 	}
 
@@ -275,8 +272,8 @@ int xtsonic_probe(struct platform_device *pdev)
 	if ((err = register_netdev(dev)))
 		goto out1;
 
-	printk("%s: SONIC ethernet @%08lx, MAC %pM, IRQ %d\n", dev->name,
-	       dev->base_addr, dev->dev_addr, dev->irq);
+	netdev_info(dev, "SONIC ethernet @%08lx, MAC %pM, IRQ %d\n",
+	            dev->base_addr, dev->dev_addr, dev->irq);
 
 	return 0;
 
-- 
2.13.5

  parent reply	other threads:[~2017-10-03  1:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03  1:07 [PATCH RESEND net 0/9] Fixes, cleanup and modernization for some legacy ethernet NIC drivers Finn Thain
2017-10-03  1:07 ` [PATCH RESEND net 8/9] net/8390: Fix redundant code Finn Thain
2017-10-03  1:07 ` [PATCH RESEND net 2/9] net/mac89x0: Remove dead or unreachable code Finn Thain
2017-10-03  1:07 ` [PATCH RESEND net 4/9] net/mac89x0: Replace custom debug logging with netif_* calls Finn Thain
2017-10-03  1:07 ` [PATCH RESEND net 3/9] net/mac89x0: Fix and modernize log messages Finn Thain
2017-10-03  1:07 ` [PATCH RESEND net 5/9] net/macmace: Fix and cleanup " Finn Thain
2017-10-03  1:07 ` [PATCH RESEND net 1/9] net/smc9194: Remove bogus CONFIG_MAC reference Finn Thain
2017-10-03  1:07 ` [PATCH RESEND net 7/9] net/sonic: Replace custom debug logging with netif_* calls Finn Thain
2017-10-03  1:07 ` Finn Thain [this message]
2017-10-03  1:07 ` [PATCH RESEND net 9/9] net/mac8390: Fix log messages Finn Thain
2017-10-04  4:41 ` [PATCH RESEND net 0/9] Fixes, cleanup and modernization for some legacy ethernet NIC drivers David Miller
2017-10-04  6:16   ` Finn Thain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8cbb2a69ee53d6ab49c8bc48864fdf3c397a52f5.1506992619.git.fthain@telegraphics.com.au \
    --to=fthain@telegraphics.com.au \
    --cc=chris@zankel.net \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®