[next-net PATCH] drivers/net/ethernet/intel/e1000e: fix unregisterednet_device ethX name output by e1000e

From: Ethan Zhao
Date: Wed Jun 06 2012 - 10:57:49 EST


commit ca3ccc6835943287b6f69e973c126a02bc4de409
Author: ethan.zhao <ethan.kernel@xxxxxxxxx>
Date: Wed Jun 6 07:32:11 2012 -0700

modified: drivers/net/ethernet/intel/e1000e/param.c

While e1000e_check_options() is called, netdev is not registered, so the
e1000e driver will print out confused ethernet interface name
(unregistered net_device) :

e1000e 0000:04:00.0:(unregistered net_device): Interrupt
Throttling Rate (ints/sec) set to dynamic conservative mode

So change e_info() back to dev_printk() by simply redefine the
e_info macro used by
e1000e_check_options() and e1000_validate_option

after applied this patch, we got:

e1000e 0000:04:00.0: Interrupt Throttling Rate (ints/sec) set to
dynamic conservative mode
e1000e 0000:04:00.0: irq 95 for MSI/MSI-X

diff --git a/drivers/net/ethernet/intel/e1000e/param.c
b/drivers/net/ethernet/intel/e1000e/param.c
index 55cc156..0f4f9db 100644
--- a/drivers/net/ethernet/intel/e1000e/param.c
+++ b/drivers/net/ethernet/intel/e1000e/param.c
@@ -186,6 +186,17 @@ struct e1000_option {
} arg;
};

+
+/**
+ * For netdev is not registered here, will get (unregistered
net_device) such confused
+ * name, so change back to dev_printk() lazy redfine the e_info()
+ */
+#ifdef e_info
+#undef e_info
+#define e_info(format, arg...) \
+ dev_printk(KERN_INFO,&adapter->pdev->dev, format, ## arg)
+#endif
+
static int __devinit e1000_validate_option(unsigned int *value,
const struct e1000_option *opt,
struct e1000_adapter *adapter)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/