提交 185095fb 编写于 作者: B Bruce Allan 提交者: Jeff Kirsher

e1000e: use more informative logging macros when netdev not yet registered

Based on a report from Ethan Zhao, before calling register_netdev() the
driver should be using logging macros that do not display the potentially
confusing "(unregistered net_device)" yet still display the useful driver
name and PCI bus/device/function.
Reported-by: NEthan Zhao <ethan.kernel@gmail.com>
Signed-off-by: NBruce Allan <bruce.w.allan@intel.com>
Tested-by: NAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 04502430
...@@ -6238,7 +6238,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, ...@@ -6238,7 +6238,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
} }
if (hw->phy.ops.check_reset_block && hw->phy.ops.check_reset_block(hw)) if (hw->phy.ops.check_reset_block && hw->phy.ops.check_reset_block(hw))
e_info("PHY reset is blocked due to SOL/IDER session.\n"); dev_info(&pdev->dev,
"PHY reset is blocked due to SOL/IDER session.\n");
/* Set initial default active device features */ /* Set initial default active device features */
netdev->features = (NETIF_F_SG | netdev->features = (NETIF_F_SG |
...@@ -6288,7 +6289,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, ...@@ -6288,7 +6289,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
if (e1000_validate_nvm_checksum(&adapter->hw) >= 0) if (e1000_validate_nvm_checksum(&adapter->hw) >= 0)
break; break;
if (i == 2) { if (i == 2) {
e_err("The NVM Checksum Is Not Valid\n"); dev_err(&pdev->dev, "The NVM Checksum Is Not Valid\n");
err = -EIO; err = -EIO;
goto err_eeprom; goto err_eeprom;
} }
...@@ -6298,13 +6299,15 @@ static int __devinit e1000_probe(struct pci_dev *pdev, ...@@ -6298,13 +6299,15 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
/* copy the MAC address */ /* copy the MAC address */
if (e1000e_read_mac_addr(&adapter->hw)) if (e1000e_read_mac_addr(&adapter->hw))
e_err("NVM Read Error while reading MAC address\n"); dev_err(&pdev->dev,
"NVM Read Error while reading MAC address\n");
memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len); memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len);
memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len); memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);
if (!is_valid_ether_addr(netdev->perm_addr)) { if (!is_valid_ether_addr(netdev->perm_addr)) {
e_err("Invalid MAC Address: %pM\n", netdev->perm_addr); dev_err(&pdev->dev, "Invalid MAC Address: %pM\n",
netdev->perm_addr);
err = -EIO; err = -EIO;
goto err_eeprom; goto err_eeprom;
} }
......
...@@ -199,16 +199,19 @@ static int __devinit e1000_validate_option(unsigned int *value, ...@@ -199,16 +199,19 @@ static int __devinit e1000_validate_option(unsigned int *value,
case enable_option: case enable_option:
switch (*value) { switch (*value) {
case OPTION_ENABLED: case OPTION_ENABLED:
e_info("%s Enabled\n", opt->name); dev_info(&adapter->pdev->dev, "%s Enabled\n",
opt->name);
return 0; return 0;
case OPTION_DISABLED: case OPTION_DISABLED:
e_info("%s Disabled\n", opt->name); dev_info(&adapter->pdev->dev, "%s Disabled\n",
opt->name);
return 0; return 0;
} }
break; break;
case range_option: case range_option:
if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) { if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
e_info("%s set to %i\n", opt->name, *value); dev_info(&adapter->pdev->dev, "%s set to %i\n",
opt->name, *value);
return 0; return 0;
} }
break; break;
...@@ -220,7 +223,8 @@ static int __devinit e1000_validate_option(unsigned int *value, ...@@ -220,7 +223,8 @@ static int __devinit e1000_validate_option(unsigned int *value,
ent = &opt->arg.l.p[i]; ent = &opt->arg.l.p[i];
if (*value == ent->i) { if (*value == ent->i) {
if (ent->str[0] != '\0') if (ent->str[0] != '\0')
e_info("%s\n", ent->str); dev_info(&adapter->pdev->dev, "%s\n",
ent->str);
return 0; return 0;
} }
} }
...@@ -230,8 +234,8 @@ static int __devinit e1000_validate_option(unsigned int *value, ...@@ -230,8 +234,8 @@ static int __devinit e1000_validate_option(unsigned int *value,
BUG(); BUG();
} }
e_info("Invalid %s value specified (%i) %s\n", opt->name, *value, dev_info(&adapter->pdev->dev, "Invalid %s value specified (%i) %s\n",
opt->err); opt->name, *value, opt->err);
*value = opt->def; *value = opt->def;
return -1; return -1;
} }
...@@ -251,8 +255,10 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) ...@@ -251,8 +255,10 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
int bd = adapter->bd_number; int bd = adapter->bd_number;
if (bd >= E1000_MAX_NIC) { if (bd >= E1000_MAX_NIC) {
e_notice("Warning: no configuration for board #%i\n", bd); dev_notice(&adapter->pdev->dev,
e_notice("Using defaults for all values\n"); "Warning: no configuration for board #%i\n", bd);
dev_notice(&adapter->pdev->dev,
"Using defaults for all values\n");
} }
{ /* Transmit Interrupt Delay */ { /* Transmit Interrupt Delay */
...@@ -366,27 +372,32 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) ...@@ -366,27 +372,32 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
* default values * default values
*/ */
if (adapter->itr > 4) if (adapter->itr > 4)
e_info("%s set to default %d\n", opt.name, dev_info(&adapter->pdev->dev,
adapter->itr); "%s set to default %d\n", opt.name,
adapter->itr);
} }
adapter->itr_setting = adapter->itr; adapter->itr_setting = adapter->itr;
switch (adapter->itr) { switch (adapter->itr) {
case 0: case 0:
e_info("%s turned off\n", opt.name); dev_info(&adapter->pdev->dev, "%s turned off\n",
opt.name);
break; break;
case 1: case 1:
e_info("%s set to dynamic mode\n", opt.name); dev_info(&adapter->pdev->dev,
"%s set to dynamic mode\n", opt.name);
adapter->itr = 20000; adapter->itr = 20000;
break; break;
case 3: case 3:
e_info("%s set to dynamic conservative mode\n", dev_info(&adapter->pdev->dev,
opt.name); "%s set to dynamic conservative mode\n",
opt.name);
adapter->itr = 20000; adapter->itr = 20000;
break; break;
case 4: case 4:
e_info("%s set to simplified (2000-8000 ints) mode\n", dev_info(&adapter->pdev->dev,
opt.name); "%s set to simplified (2000-8000 ints) mode\n",
opt.name);
break; break;
default: default:
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册