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

net/mac8390: Fix log messages

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: 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 494a973e
...@@ -308,14 +308,14 @@ static bool mac8390_rsrc_init(struct net_device *dev, ...@@ -308,14 +308,14 @@ static bool mac8390_rsrc_init(struct net_device *dev,
*/ */
if (nubus_get_func_dir(fres, &dir) == -1) { if (nubus_get_func_dir(fres, &dir) == -1) {
pr_err("%s: Unable to get Nubus functional directory for slot %X!\n", dev_err(&board->dev,
dev->name, board->slot); "Unable to get Nubus functional directory\n");
return false; return false;
} }
/* Get the MAC address */ /* Get the MAC address */
if (nubus_find_rsrc(&dir, NUBUS_RESID_MAC_ADDRESS, &ent) == -1) { 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; return false;
} }
...@@ -325,8 +325,8 @@ static bool mac8390_rsrc_init(struct net_device *dev, ...@@ -325,8 +325,8 @@ static bool mac8390_rsrc_init(struct net_device *dev,
nubus_rewinddir(&dir); nubus_rewinddir(&dir);
if (nubus_find_rsrc(&dir, NUBUS_RESID_MINOR_BASEOS, if (nubus_find_rsrc(&dir, NUBUS_RESID_MINOR_BASEOS,
&ent) == -1) { &ent) == -1) {
pr_err("%s: Memory offset resource for slot %X not found!\n", dev_err(&board->dev,
dev->name, board->slot); "Memory offset resource not found\n");
return false; return false;
} }
nubus_get_rsrc_mem(&offset, &ent, 4); nubus_get_rsrc_mem(&offset, &ent, 4);
...@@ -336,8 +336,8 @@ static bool mac8390_rsrc_init(struct net_device *dev, ...@@ -336,8 +336,8 @@ static bool mac8390_rsrc_init(struct net_device *dev,
nubus_rewinddir(&dir); nubus_rewinddir(&dir);
if (nubus_find_rsrc(&dir, NUBUS_RESID_MINOR_LENGTH, if (nubus_find_rsrc(&dir, NUBUS_RESID_MINOR_LENGTH,
&ent) == -1) { &ent) == -1) {
pr_info("%s: Memory length resource for slot %X not found, probing\n", dev_info(&board->dev,
dev->name, board->slot); "Memory length resource not found, probing\n");
offset = mac8390_memsize(dev->mem_start); offset = mac8390_memsize(dev->mem_start);
} else { } else {
nubus_get_rsrc_mem(&offset, &ent, 4); nubus_get_rsrc_mem(&offset, &ent, 4);
...@@ -380,8 +380,8 @@ static bool mac8390_rsrc_init(struct net_device *dev, ...@@ -380,8 +380,8 @@ static bool mac8390_rsrc_init(struct net_device *dev,
break; break;
default: default:
pr_err("Card type %s is unsupported, sorry\n", dev_err(&board->dev,
board->name); "No known base address for card type\n");
return false; return false;
} }
} }
...@@ -533,7 +533,8 @@ static int mac8390_initdev(struct net_device *dev, struct nubus_board *board, ...@@ -533,7 +533,8 @@ static int mac8390_initdev(struct net_device *dev, struct nubus_board *board,
case MAC8390_APPLE: case MAC8390_APPLE:
switch (mac8390_testio(dev->mem_start)) { switch (mac8390_testio(dev->mem_start)) {
case ACCESS_UNKNOWN: 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; return -ENODEV;
case ACCESS_16: case ACCESS_16:
...@@ -599,18 +600,15 @@ static int mac8390_initdev(struct net_device *dev, struct nubus_board *board, ...@@ -599,18 +600,15 @@ static int mac8390_initdev(struct net_device *dev, struct nubus_board *board,
break; break;
default: default:
pr_err("Card type %s is unsupported, sorry\n", dev_err(&board->dev, "Unsupported card type\n");
board->name);
return -ENODEV; return -ENODEV;
} }
__NS8390_init(dev, 0); __NS8390_init(dev, 0);
/* Good, done, now spit out some messages */ /* Good, done, now spit out some messages */
pr_info("%s: %s in slot %X (type %s)\n", dev_info(&board->dev, "%s (type %s)\n", board->name, cardname[type]);
dev->name, board->name, board->slot, dev_info(&board->dev, "MAC %pM, IRQ %d, %d KB shared memory at %#lx, %d-bit access.\n",
cardname[type]);
pr_info("MAC %pM IRQ %d, %d KB shared memory at %#lx, %d-bit access.\n",
dev->dev_addr, dev->irq, dev->dev_addr, dev->irq,
(unsigned int)(dev->mem_end - dev->mem_start) >> 10, (unsigned int)(dev->mem_end - dev->mem_start) >> 10,
dev->mem_start, access_bitmode ? 32 : 16); dev->mem_start, access_bitmode ? 32 : 16);
......
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