aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mac8390.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-01-04 06:53:01 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-06 23:44:03 -0500
commit18c0019102228875cb0f6f252dad5148491e96b2 (patch)
tree84f4710fd101b0e387d628f73b4c26b284e8e358 /drivers/net/mac8390.c
parent5c7fffd0e3b57cb63f50bbd710868f012d67654f (diff)
drivers/net/mac8390.c: Convert printk(KERN_<level> to pr_<level>(
Use printk_once Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt Convert printks without KERN_<level> to pr_info and pr_cont Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mac8390.c')
-rw-r--r--drivers/net/mac8390.c57
1 files changed, 25 insertions, 32 deletions
diff --git a/drivers/net/mac8390.c b/drivers/net/mac8390.c
index 517cee45c086..8bd09e280c9e 100644
--- a/drivers/net/mac8390.c
+++ b/drivers/net/mac8390.c
@@ -17,6 +17,8 @@
17/* 2002-12-30: Try to support more cards, some clues from NetBSD driver */ 17/* 2002-12-30: Try to support more cards, some clues from NetBSD driver */
18/* 2003-12-26: Make sure Asante cards always work. */ 18/* 2003-12-26: Make sure Asante cards always work. */
19 19
20#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
21
20#include <linux/module.h> 22#include <linux/module.h>
21#include <linux/kernel.h> 23#include <linux/kernel.h>
22#include <linux/types.h> 24#include <linux/types.h>
@@ -42,7 +44,7 @@
42#include <asm/macints.h> 44#include <asm/macints.h>
43 45
44static char version[] = 46static char version[] =
45 "mac8390.c: v0.4 2001-05-15 David Huggins-Daines <dhd@debian.org> and others\n"; 47 "v0.4 2001-05-15 David Huggins-Daines <dhd@debian.org> and others\n";
46 48
47#define EI_SHIFT(x) (ei_local->reg_offset[x]) 49#define EI_SHIFT(x) (ei_local->reg_offset[x])
48#define ei_inb(port) in_8(port) 50#define ei_inb(port) in_8(port)
@@ -288,7 +290,6 @@ struct net_device * __init mac8390_probe(int unit)
288{ 290{
289 struct net_device *dev; 291 struct net_device *dev;
290 volatile unsigned short *i; 292 volatile unsigned short *i;
291 int version_disp = 0;
292 struct nubus_dev * ndev = NULL; 293 struct nubus_dev * ndev = NULL;
293 int err = -ENODEV; 294 int err = -ENODEV;
294 295
@@ -320,10 +321,7 @@ struct net_device * __init mac8390_probe(int unit)
320 if ((cardtype = mac8390_ident(ndev)) == MAC8390_NONE) 321 if ((cardtype = mac8390_ident(ndev)) == MAC8390_NONE)
321 continue; 322 continue;
322 323
323 if (version_disp == 0) { 324 printk_once(KERN_INFO pr_fmt(version));
324 version_disp = 1;
325 printk(version);
326 }
327 325
328 dev->irq = SLOT2IRQ(ndev->board->slot); 326 dev->irq = SLOT2IRQ(ndev->board->slot);
329 /* This is getting to be a habit */ 327 /* This is getting to be a habit */
@@ -333,16 +331,14 @@ struct net_device * __init mac8390_probe(int unit)
333 of where its memory and registers are. */ 331 of where its memory and registers are. */
334 332
335 if (nubus_get_func_dir(ndev, &dir) == -1) { 333 if (nubus_get_func_dir(ndev, &dir) == -1) {
336 printk(KERN_ERR "%s: Unable to get Nubus functional" 334 pr_err("%s: Unable to get Nubus functional directory for slot %X!\n",
337 " directory for slot %X!\n",
338 dev->name, ndev->board->slot); 335 dev->name, ndev->board->slot);
339 continue; 336 continue;
340 } 337 }
341 338
342 /* Get the MAC address */ 339 /* Get the MAC address */
343 if ((nubus_find_rsrc(&dir, NUBUS_RESID_MAC_ADDRESS, &ent)) == -1) { 340 if ((nubus_find_rsrc(&dir, NUBUS_RESID_MAC_ADDRESS, &ent)) == -1) {
344 printk(KERN_INFO "%s: Couldn't get MAC address!\n", 341 pr_info("%s: Couldn't get MAC address!\n", dev->name);
345 dev->name);
346 continue; 342 continue;
347 } else { 343 } else {
348 nubus_get_rsrc_mem(dev->dev_addr, &ent, 6); 344 nubus_get_rsrc_mem(dev->dev_addr, &ent, 6);
@@ -351,8 +347,7 @@ struct net_device * __init mac8390_probe(int unit)
351 if (useresources[cardtype] == 1) { 347 if (useresources[cardtype] == 1) {
352 nubus_rewinddir(&dir); 348 nubus_rewinddir(&dir);
353 if (nubus_find_rsrc(&dir, NUBUS_RESID_MINOR_BASEOS, &ent) == -1) { 349 if (nubus_find_rsrc(&dir, NUBUS_RESID_MINOR_BASEOS, &ent) == -1) {
354 printk(KERN_ERR "%s: Memory offset resource" 350 pr_err("%s: Memory offset resource for slot %X not found!\n",
355 " for slot %X not found!\n",
356 dev->name, ndev->board->slot); 351 dev->name, ndev->board->slot);
357 continue; 352 continue;
358 } 353 }
@@ -362,10 +357,8 @@ struct net_device * __init mac8390_probe(int unit)
362 dev->base_addr = dev->mem_start + 0x10000; 357 dev->base_addr = dev->mem_start + 0x10000;
363 nubus_rewinddir(&dir); 358 nubus_rewinddir(&dir);
364 if (nubus_find_rsrc(&dir, NUBUS_RESID_MINOR_LENGTH, &ent) == -1) { 359 if (nubus_find_rsrc(&dir, NUBUS_RESID_MINOR_LENGTH, &ent) == -1) {
365 printk(KERN_INFO "%s: Memory length resource" 360 pr_info("%s: Memory length resource for slot %X not found, probing\n",
366 " for slot %X not found" 361 dev->name, ndev->board->slot);
367 ", probing\n",
368 dev->name, ndev->board->slot);
369 offset = mac8390_memsize(dev->mem_start); 362 offset = mac8390_memsize(dev->mem_start);
370 } else { 363 } else {
371 nubus_get_rsrc_mem(&offset, &ent, 4); 364 nubus_get_rsrc_mem(&offset, &ent, 4);
@@ -417,8 +410,7 @@ struct net_device * __init mac8390_probe(int unit)
417 break; 410 break;
418 411
419 default: 412 default:
420 printk(KERN_ERR "Card type %s is" 413 pr_err("Card type %s is unsupported, sorry\n",
421 " unsupported, sorry\n",
422 ndev->board->name); 414 ndev->board->name);
423 continue; 415 continue;
424 } 416 }
@@ -458,7 +450,7 @@ int init_module(void)
458 dev_mac890[i] = dev; 450 dev_mac890[i] = dev;
459 } 451 }
460 if (!i) { 452 if (!i) {
461 printk(KERN_NOTICE "mac8390.c: No useable cards found, driver NOT installed.\n"); 453 pr_notice("No useable cards found, driver NOT installed.\n");
462 return -ENODEV; 454 return -ENODEV;
463 } 455 }
464 return 0; 456 return 0;
@@ -545,7 +537,7 @@ static int __init mac8390_initdev(struct net_device * dev, struct nubus_dev * nd
545 case MAC8390_APPLE: 537 case MAC8390_APPLE:
546 switch (mac8390_testio(dev->mem_start)) { 538 switch (mac8390_testio(dev->mem_start)) {
547 case ACCESS_UNKNOWN: 539 case ACCESS_UNKNOWN:
548 printk("Don't know how to access card memory!\n"); 540 pr_info("Don't know how to access card memory!\n");
549 return -ENODEV; 541 return -ENODEV;
550 break; 542 break;
551 543
@@ -612,20 +604,21 @@ static int __init mac8390_initdev(struct net_device * dev, struct nubus_dev * nd
612 break; 604 break;
613 605
614 default: 606 default:
615 printk(KERN_ERR "Card type %s is unsupported, sorry\n", ndev->board->name); 607 pr_err("Card type %s is unsupported, sorry\n",
608 ndev->board->name);
616 return -ENODEV; 609 return -ENODEV;
617 } 610 }
618 611
619 __NS8390_init(dev, 0); 612 __NS8390_init(dev, 0);
620 613
621 /* Good, done, now spit out some messages */ 614 /* Good, done, now spit out some messages */
622 printk(KERN_INFO "%s: %s in slot %X (type %s)\n", 615 pr_info("%s: %s in slot %X (type %s)\n",
623 dev->name, ndev->board->name, ndev->board->slot, cardname[type]); 616 dev->name, ndev->board->name, ndev->board->slot,
624 printk(KERN_INFO 617 cardname[type]);
625 "MAC %pM IRQ %d, %d KB shared memory at %#lx, %d-bit access.\n", 618 pr_info("MAC %pM IRQ %d, %d KB shared memory at %#lx, %d-bit access.\n",
626 dev->dev_addr, dev->irq, 619 dev->dev_addr, dev->irq,
627 (unsigned int)(dev->mem_end - dev->mem_start) >> 10, 620 (unsigned int)(dev->mem_end - dev->mem_start) >> 10,
628 dev->mem_start, access_bitmode ? 32 : 16); 621 dev->mem_start, access_bitmode ? 32 : 16);
629 return 0; 622 return 0;
630} 623}
631 624
@@ -633,7 +626,7 @@ static int mac8390_open(struct net_device *dev)
633{ 626{
634 __ei_open(dev); 627 __ei_open(dev);
635 if (request_irq(dev->irq, __ei_interrupt, 0, "8390 Ethernet", dev)) { 628 if (request_irq(dev->irq, __ei_interrupt, 0, "8390 Ethernet", dev)) {
636 printk ("%s: unable to get IRQ %d.\n", dev->name, dev->irq); 629 pr_info("%s: unable to get IRQ %d.\n", dev->name, dev->irq);
637 return -EAGAIN; 630 return -EAGAIN;
638 } 631 }
639 return 0; 632 return 0;
@@ -650,7 +643,7 @@ static void mac8390_no_reset(struct net_device *dev)
650{ 643{
651 ei_status.txing = 0; 644 ei_status.txing = 0;
652 if (ei_debug > 1) 645 if (ei_debug > 1)
653 printk("reset not supported\n"); 646 pr_info("reset not supported\n");
654 return; 647 return;
655} 648}
656 649
@@ -658,11 +651,11 @@ static void interlan_reset(struct net_device *dev)
658{ 651{
659 unsigned char *target=nubus_slot_addr(IRQ2SLOT(dev->irq)); 652 unsigned char *target=nubus_slot_addr(IRQ2SLOT(dev->irq));
660 if (ei_debug > 1) 653 if (ei_debug > 1)
661 printk("Need to reset the NS8390 t=%lu...", jiffies); 654 pr_info("Need to reset the NS8390 t=%lu...", jiffies);
662 ei_status.txing = 0; 655 ei_status.txing = 0;
663 target[0xC0000] = 0; 656 target[0xC0000] = 0;
664 if (ei_debug > 1) 657 if (ei_debug > 1)
665 printk("reset complete\n"); 658 pr_cont("reset complete\n");
666 return; 659 return;
667} 660}
668 661