linux-m68k.vger.kernel.org archive mirror
 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-m68k@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH net v4 10/13] net/mac8390: Fix log messages
Date: Sun, 11 Feb 2018 22:08:43 -0500 (EST)	[thread overview]
Message-ID: <08b0c1c8cd2622ec0b35bae44708c5f9217c5bbd.1518397634.git.fthain@telegraphics.com.au> (raw)
In-Reply-To: <cover.1518397634.git.fthain@telegraphics.com.au>

Use dev_foo() to log the slot number instead of the unexpanded "eth%d"
format string.
Disambiguate the two identical "Card type %s is unsupported" messages.

Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
---
 drivers/net/ethernet/8390/mac8390.c | 36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)

diff --git a/drivers/net/ethernet/8390/mac8390.c b/drivers/net/ethernet/8390/mac8390.c
index 1113add733b6..44b20bce554e 100644
--- a/drivers/net/ethernet/8390/mac8390.c
+++ b/drivers/net/ethernet/8390/mac8390.c
@@ -308,14 +308,14 @@ static bool mac8390_rsrc_init(struct net_device *dev,
 	 */
 
 	if (nubus_get_func_dir(fres, &dir) == -1) {
-		pr_err("%s: Unable to get Nubus functional directory for slot %X!\n",
-		       dev->name, board->slot);
+		dev_err(&board->dev,
+			"Unable to get Nubus functional directory\n");
 		return false;
 	}
 
 	/* Get the MAC address */
 	if (nubus_find_rsrc(&dir, NUBUS_RESID_MAC_ADDRESS, &ent) == -1) {
-		pr_info("%s: Couldn't get MAC address!\n", dev->name);
+		dev_info(&board->dev, "MAC address resource not found\n");
 		return false;
 	}
 
@@ -325,8 +325,8 @@ static bool mac8390_rsrc_init(struct net_device *dev,
 		nubus_rewinddir(&dir);
 		if (nubus_find_rsrc(&dir, NUBUS_RESID_MINOR_BASEOS,
 				    &ent) == -1) {
-			pr_err("%s: Memory offset resource for slot %X not found!\n",
-			       dev->name, board->slot);
+			dev_err(&board->dev,
+				"Memory offset resource not found\n");
 			return false;
 		}
 		nubus_get_rsrc_mem(&offset, &ent, 4);
@@ -336,8 +336,8 @@ static bool mac8390_rsrc_init(struct net_device *dev,
 		nubus_rewinddir(&dir);
 		if (nubus_find_rsrc(&dir, NUBUS_RESID_MINOR_LENGTH,
 				    &ent) == -1) {
-			pr_info("%s: Memory length resource for slot %X not found, probing\n",
-				dev->name, board->slot);
+			dev_info(&board->dev,
+				 "Memory length resource not found, probing\n");
 			offset = mac8390_memsize(dev->mem_start);
 		} else {
 			nubus_get_rsrc_mem(&offset, &ent, 4);
@@ -380,8 +380,8 @@ static bool mac8390_rsrc_init(struct net_device *dev,
 			break;
 
 		default:
-			pr_err("Card type %s is unsupported, sorry\n",
-			       board->name);
+			dev_err(&board->dev,
+				"No known base address for card type\n");
 			return false;
 		}
 	}
@@ -536,7 +536,8 @@ static int mac8390_initdev(struct net_device *dev, struct nubus_board *board,
 	case MAC8390_APPLE:
 		switch (mac8390_testio(dev->mem_start)) {
 		case ACCESS_UNKNOWN:
-			pr_err("Don't know how to access card memory!\n");
+			dev_err(&board->dev,
+				"Don't know how to access card memory\n");
 			return -ENODEV;
 
 		case ACCESS_16:
@@ -602,21 +603,18 @@ static int mac8390_initdev(struct net_device *dev, struct nubus_board *board,
 		break;
 
 	default:
-		pr_err("Card type %s is unsupported, sorry\n",
-		       board->name);
+		dev_err(&board->dev, "Unsupported card type\n");
 		return -ENODEV;
 	}
 
 	__NS8390_init(dev, 0);
 
 	/* Good, done, now spit out some messages */
-	pr_info("%s: %s in slot %X (type %s)\n",
-		dev->name, board->name, board->slot,
-		cardname[type]);
-	pr_info("MAC %pM IRQ %d, %d KB shared memory at %#lx, %d-bit access.\n",
-		dev->dev_addr, dev->irq,
-		(unsigned int)(dev->mem_end - dev->mem_start) >> 10,
-		dev->mem_start, access_bitmode ? 32 : 16);
+	dev_info(&board->dev, "%s (type %s)\n", board->name, cardname[type]);
+	dev_info(&board->dev, "MAC %pM, IRQ %d, %d KB shared memory at %#lx, %d-bit access.\n",
+		 dev->dev_addr, dev->irq,
+		 (unsigned int)(dev->mem_end - dev->mem_start) >> 10,
+		 dev->mem_start, access_bitmode ? 32 : 16);
 	return 0;
 }
 
-- 
2.13.6

  parent reply	other threads:[~2018-02-12  3:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-12  3:08 [PATCH net v4 00/13] Fixes, cleanup and modernization for some legacy ethernet NIC drivers Finn Thain
2018-02-12  3:08 ` [PATCH net v4 08/13] net/mac89x0: Replace custom debug logging with netif_* calls Finn Thain
2018-02-12  3:08 ` [PATCH net v4 01/13] net/8390: Remove redundant make dependencies Finn Thain
2018-02-12  8:16   ` Geert Uytterhoeven
2018-02-12  3:08 ` Finn Thain [this message]
2018-02-12  3:08 ` [PATCH net v4 04/13] net/macmace: Fix and clean up log messages Finn Thain
2018-02-12  3:08 ` [PATCH net v4 11/13] net/macsonic: Convert to nubus_driver Finn Thain
2018-02-12  3:08 ` [PATCH net v4 02/13] net/8390: Fix msg_enable patch snafu Finn Thain
2018-02-12 15:39   ` David Miller
2018-02-13  5:03     ` Finn Thain
2018-02-13 14:58       ` David Miller
2018-02-14 22:11         ` Finn Thain
2018-02-14 22:15           ` David Miller
2018-02-16  3:47             ` Finn Thain
2018-02-12  3:08 ` [PATCH net v4 06/13] net/mac89x0: Convert to platform_driver Finn Thain
2018-02-12  8:25   ` Geert Uytterhoeven
2018-02-12  3:08 ` [PATCH net v4 07/13] net/mac89x0: Fix and modernize log messages Finn Thain
2018-02-12  3:08 ` [PATCH net v4 05/13] net/mac89x0: Remove dead or unreachable code Finn Thain
2018-02-12  3:08 ` [PATCH net v4 03/13] net/smc9194: Remove bogus CONFIG_MAC reference Finn Thain
2018-02-12  3:08 ` [PATCH net v4 09/13] net/mac8390: Convert to nubus_driver Finn Thain
2018-02-12  8:29   ` Geert Uytterhoeven
2018-02-13  5:03     ` Finn Thain
2018-02-12  3:08 ` [PATCH net v4 12/13] net/sonic: Clean up and modernize log messages Finn Thain
2018-02-12  3:08 ` [PATCH net v4 13/13] net/sonic: Replace custom debug logging with netif_* calls 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=08b0c1c8cd2622ec0b35bae44708c5f9217c5bbd.1518397634.git.fthain@telegraphics.com.au \
    --to=fthain@telegraphics.com.au \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).