[PATCH] smc-ultra: get rid of "eth%d" message

Previous thread: [PATCH] eCryptfs: Privileged kthread for lower file opens by Michael Halcrow on Tuesday, May 20, 2008 - 2:46 pm. (10 messages)

Next thread: [patch] x86: don't read maxlvt before checking if APIC is mapped by Chuck Ebbert on Tuesday, May 20, 2008 - 3:18 pm. (1 message)
From: Németh Márton
Date: Tuesday, May 20, 2008 - 3:05 pm

Print out the dev->name only after register_netdev(). If the
dev->name is printk()ed out before calling register_netdev()
the result will be "eth%d" in the dmesg instead of "eth0".

Signed-off-by: Márton Németh <nm127@freemail.hu>

---
--- linux-2.6.26-rc3/drivers/net/smc-ultra.c.orig	2008-04-17 04:49:44.000000000 +0200
+++ linux-2.6.26-rc3/drivers/net/smc-ultra.c	2008-05-20 22:04:15.000000000 +0200
@@ -228,9 +228,6 @@ static int __init ultra_probe1(struct ne
 	for (i = 0; i < 6; i++)
 		dev->dev_addr[i] = inb(ioaddr + 8 + i);

-	printk("%s: %s at %#3x, %s", dev->name, model_name,
-	       ioaddr, print_mac(mac, dev->dev_addr));
-
 	/* Switch from the station address to the alternate register set and
 	   read the useful registers there. */
 	outb(0x80 | reg4, ioaddr + 4);
@@ -253,8 +250,10 @@ static int __init ultra_probe1(struct ne
 		irq = irqmap[((irqreg & 0x40) >> 4) + ((irqreg & 0x0c) >> 2)];

 		if (irq == 0) {
-			printk(", failed to detect IRQ line.\n");
-			retval =  -EAGAIN;
+			printk(KERN_ERR "%s at %#3x, %s, "
+			       "failed to detect IRQ line.\n", model_name,
+			       ioaddr, print_mac(mac, dev->dev_addr));
+			retval = -EAGAIN;
 			goto out;
 		}
 		dev->irq = irq;
@@ -280,22 +279,19 @@ static int __init ultra_probe1(struct ne

 	ei_status.mem = ioremap(dev->mem_start, (ei_status.stop_page - START_PG)*256);
 	if (!ei_status.mem) {
-		printk(", failed to ioremap.\n");
-		retval =  -ENOMEM;
+		printk(KERN_ERR "%s at %#3x, %s, failed to ioremap.\n",
+		       model_name, ioaddr, print_mac(mac, dev->dev_addr));
+		retval = -ENOMEM;
 		goto out;
 	}

 	dev->mem_end = dev->mem_start + (ei_status.stop_page - START_PG)*256;

 	if (piomode) {
-		printk(",%s IRQ %d programmed-I/O mode.\n",
-			   eeprom_irq ? "EEPROM" : "assigned ", dev->irq);
 		ei_status.block_input = &ultra_pio_input;
 		ei_status.block_output = &ultra_pio_output;
 		ei_status.get_8390_hdr = &ultra_pio_get_hdr;
 	} else {
-		printk(",%s IRQ %d memory %#lx-%#lx.\n", eeprom_irq ...
Previous thread: [PATCH] eCryptfs: Privileged kthread for lower file opens by Michael Halcrow on Tuesday, May 20, 2008 - 2:46 pm. (10 messages)

Next thread: [patch] x86: don't read maxlvt before checking if APIC is mapped by Chuck Ebbert on Tuesday, May 20, 2008 - 3:18 pm. (1 message)