[PATCH] e1000e: Avoid duplicated output of device name in kernel warning

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Frans Pop
Date: Monday, August 25, 2008 - 11:02 am

On Monday 18 August 2008, Frans Pop wrote:

With the patch below the first message becomes
  e1000e 0000:01:00.0: Warning: detected DSPD enabled in EEPROM
which makes it similar to directly preceding messages.


I'm still wondering about this...
Same goes for the "warning" about ASPM.

---
From: Frans Pop <elendil@planet.nl>

Use dev_warn instead of e_warn in e1000_eeprom_checks() as the
interface name has not yet been assigned at that point.
    
Signed-off-by: Frans Pop <elendil@planet.nl>

diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index d266510..d02a659 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -4335,13 +4335,15 @@ static void e1000_eeprom_checks(struct 
e1000_adapter *adapter)
 	ret_val = e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &buf);
 	if (!(le16_to_cpu(buf) & (1 << 0))) {
 		/* Deep Smart Power Down (DSPD) */
-		e_warn("Warning: detected DSPD enabled in EEPROM\n");
+		dev_warn(&adapter->pdev->dev,
+			 "Warning: detected DSPD enabled in EEPROM\n");
 	}
 
 	ret_val = e1000_read_nvm(hw, NVM_INIT_3GIO_3, 1, &buf);
 	if (le16_to_cpu(buf) & (3 << 2)) {
 		/* ASPM enable */
-		e_warn("Warning: detected ASPM enabled in EEPROM\n");
+		dev_warn(&adapter->pdev->dev,
+			 "Warning: detected ASPM enabled in EEPROM\n");
 	}
 }
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] e1000e: Avoid duplicated output of device name in ..., Frans Pop, (Mon Aug 25, 11:02 am)