Commit ba211e3e authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

drivers/net/atl1e: Use netdev_printk helpers

Logging messages sometimes had duplicated "ATL1E" output.

For instance:
ATL1E 0000:03:00.0: ATL1E: eth0 NIC Link is Up<100 Mbps Full Duplex>
is now:
ATL1E 0000:03:00.0: eth0: NIC Link is Up <100 Mbps Full Duplex>

Add some consistency to logging messages
Add some missing \n's to logging messages
Miscellaneous typo spelling corrections
Change atl1e_validate_option argument from pdev to adapter
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 571ba423
...@@ -394,7 +394,6 @@ static int atl1e_phy_setup_autoneg_adv(struct atl1e_hw *hw) ...@@ -394,7 +394,6 @@ static int atl1e_phy_setup_autoneg_adv(struct atl1e_hw *hw)
int atl1e_phy_commit(struct atl1e_hw *hw) int atl1e_phy_commit(struct atl1e_hw *hw)
{ {
struct atl1e_adapter *adapter = hw->adapter; struct atl1e_adapter *adapter = hw->adapter;
struct pci_dev *pdev = adapter->pdev;
int ret_val; int ret_val;
u16 phy_data; u16 phy_data;
...@@ -415,12 +414,12 @@ int atl1e_phy_commit(struct atl1e_hw *hw) ...@@ -415,12 +414,12 @@ int atl1e_phy_commit(struct atl1e_hw *hw)
} }
if (0 != (val & (MDIO_START | MDIO_BUSY))) { if (0 != (val & (MDIO_START | MDIO_BUSY))) {
dev_err(&pdev->dev, netdev_err(adapter->netdev,
"pcie linkdown at least for 25ms\n"); "pcie linkdown at least for 25ms\n");
return ret_val; return ret_val;
} }
dev_err(&pdev->dev, "pcie linkup after %d ms\n", i); netdev_err(adapter->netdev, "pcie linkup after %d ms\n", i);
} }
return 0; return 0;
} }
...@@ -428,7 +427,6 @@ int atl1e_phy_commit(struct atl1e_hw *hw) ...@@ -428,7 +427,6 @@ int atl1e_phy_commit(struct atl1e_hw *hw)
int atl1e_phy_init(struct atl1e_hw *hw) int atl1e_phy_init(struct atl1e_hw *hw)
{ {
struct atl1e_adapter *adapter = hw->adapter; struct atl1e_adapter *adapter = hw->adapter;
struct pci_dev *pdev = adapter->pdev;
s32 ret_val; s32 ret_val;
u16 phy_val; u16 phy_val;
...@@ -492,20 +490,22 @@ int atl1e_phy_init(struct atl1e_hw *hw) ...@@ -492,20 +490,22 @@ int atl1e_phy_init(struct atl1e_hw *hw)
/*Enable PHY LinkChange Interrupt */ /*Enable PHY LinkChange Interrupt */
ret_val = atl1e_write_phy_reg(hw, MII_INT_CTRL, 0xC00); ret_val = atl1e_write_phy_reg(hw, MII_INT_CTRL, 0xC00);
if (ret_val) { if (ret_val) {
dev_err(&pdev->dev, "Error enable PHY linkChange Interrupt\n"); netdev_err(adapter->netdev,
"Error enable PHY linkChange Interrupt\n");
return ret_val; return ret_val;
} }
/* setup AutoNeg parameters */ /* setup AutoNeg parameters */
ret_val = atl1e_phy_setup_autoneg_adv(hw); ret_val = atl1e_phy_setup_autoneg_adv(hw);
if (ret_val) { if (ret_val) {
dev_err(&pdev->dev, "Error Setting up Auto-Negotiation\n"); netdev_err(adapter->netdev,
"Error Setting up Auto-Negotiation\n");
return ret_val; return ret_val;
} }
/* SW.Reset & En-Auto-Neg to restart Auto-Neg*/ /* SW.Reset & En-Auto-Neg to restart Auto-Neg*/
dev_dbg(&pdev->dev, "Restarting Auto-Neg"); netdev_dbg(adapter->netdev, "Restarting Auto-Negotiation\n");
ret_val = atl1e_phy_commit(hw); ret_val = atl1e_phy_commit(hw);
if (ret_val) { if (ret_val) {
dev_err(&pdev->dev, "Error Resetting the phy"); netdev_err(adapter->netdev, "Error resetting the phy\n");
return ret_val; return ret_val;
} }
...@@ -559,9 +559,8 @@ int atl1e_reset_hw(struct atl1e_hw *hw) ...@@ -559,9 +559,8 @@ int atl1e_reset_hw(struct atl1e_hw *hw)
} }
if (timeout >= AT_HW_MAX_IDLE_DELAY) { if (timeout >= AT_HW_MAX_IDLE_DELAY) {
dev_err(&pdev->dev, netdev_err(adapter->netdev,
"MAC state machine cann't be idle since" "MAC state machine can't be idle since disabled for 10ms second\n");
" disabled for 10ms second\n");
return AT_ERR_TIMEOUT; return AT_ERR_TIMEOUT;
} }
......
This diff is collapsed.
...@@ -116,7 +116,7 @@ struct atl1e_option { ...@@ -116,7 +116,7 @@ struct atl1e_option {
} arg; } arg;
}; };
static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt, struct pci_dev *pdev) static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt, struct atl1e_adapter *adapter)
{ {
if (*value == OPTION_UNSET) { if (*value == OPTION_UNSET) {
*value = opt->def; *value = opt->def;
...@@ -127,16 +127,19 @@ static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt, ...@@ -127,16 +127,19 @@ static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt,
case enable_option: case enable_option:
switch (*value) { switch (*value) {
case OPTION_ENABLED: case OPTION_ENABLED:
dev_info(&pdev->dev, "%s Enabled\n", opt->name); netdev_info(adapter->netdev,
"%s Enabled\n", opt->name);
return 0; return 0;
case OPTION_DISABLED: case OPTION_DISABLED:
dev_info(&pdev->dev, "%s Disabled\n", opt->name); netdev_info(adapter->netdev,
"%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) {
dev_info(&pdev->dev, "%s set to %i\n", opt->name, *value); netdev_info(adapter->netdev, "%s set to %i\n",
opt->name, *value);
return 0; return 0;
} }
break; break;
...@@ -148,8 +151,8 @@ static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt, ...@@ -148,8 +151,8 @@ static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt,
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')
dev_info(&pdev->dev, "%s\n", netdev_info(adapter->netdev,
ent->str); "%s\n", ent->str);
return 0; return 0;
} }
} }
...@@ -159,8 +162,8 @@ static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt, ...@@ -159,8 +162,8 @@ static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt,
BUG(); BUG();
} }
dev_info(&pdev->dev, "Invalid %s specified (%i) %s\n", netdev_info(adapter->netdev, "Invalid %s specified (%i) %s\n",
opt->name, *value, opt->err); opt->name, *value, opt->err);
*value = opt->def; *value = opt->def;
return -1; return -1;
} }
...@@ -176,11 +179,13 @@ static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt, ...@@ -176,11 +179,13 @@ static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt,
*/ */
void __devinit atl1e_check_options(struct atl1e_adapter *adapter) void __devinit atl1e_check_options(struct atl1e_adapter *adapter)
{ {
struct pci_dev *pdev = adapter->pdev;
int bd = adapter->bd_number; int bd = adapter->bd_number;
if (bd >= ATL1E_MAX_NIC) { if (bd >= ATL1E_MAX_NIC) {
dev_notice(&pdev->dev, "no configuration for board #%i\n", bd); netdev_notice(adapter->netdev,
dev_notice(&pdev->dev, "Using defaults for all values\n"); "no configuration for board #%i\n", bd);
netdev_notice(adapter->netdev,
"Using defaults for all values\n");
} }
{ /* Transmit Ring Size */ { /* Transmit Ring Size */
...@@ -196,7 +201,7 @@ void __devinit atl1e_check_options(struct atl1e_adapter *adapter) ...@@ -196,7 +201,7 @@ void __devinit atl1e_check_options(struct atl1e_adapter *adapter)
int val; int val;
if (num_tx_desc_cnt > bd) { if (num_tx_desc_cnt > bd) {
val = tx_desc_cnt[bd]; val = tx_desc_cnt[bd];
atl1e_validate_option(&val, &opt, pdev); atl1e_validate_option(&val, &opt, adapter);
adapter->tx_ring.count = (u16) val & 0xFFFC; adapter->tx_ring.count = (u16) val & 0xFFFC;
} else } else
adapter->tx_ring.count = (u16)opt.def; adapter->tx_ring.count = (u16)opt.def;
...@@ -215,7 +220,7 @@ void __devinit atl1e_check_options(struct atl1e_adapter *adapter) ...@@ -215,7 +220,7 @@ void __devinit atl1e_check_options(struct atl1e_adapter *adapter)
int val; int val;
if (num_rx_mem_size > bd) { if (num_rx_mem_size > bd) {
val = rx_mem_size[bd]; val = rx_mem_size[bd];
atl1e_validate_option(&val, &opt, pdev); atl1e_validate_option(&val, &opt, adapter);
adapter->rx_ring.page_size = (u32)val * 1024; adapter->rx_ring.page_size = (u32)val * 1024;
} else { } else {
adapter->rx_ring.page_size = (u32)opt.def * 1024; adapter->rx_ring.page_size = (u32)opt.def * 1024;
...@@ -235,7 +240,7 @@ void __devinit atl1e_check_options(struct atl1e_adapter *adapter) ...@@ -235,7 +240,7 @@ void __devinit atl1e_check_options(struct atl1e_adapter *adapter)
int val; int val;
if (num_int_mod_timer > bd) { if (num_int_mod_timer > bd) {
val = int_mod_timer[bd]; val = int_mod_timer[bd];
atl1e_validate_option(&val, &opt, pdev); atl1e_validate_option(&val, &opt, adapter);
adapter->hw.imt = (u16) val; adapter->hw.imt = (u16) val;
} else } else
adapter->hw.imt = (u16)(opt.def); adapter->hw.imt = (u16)(opt.def);
...@@ -254,7 +259,7 @@ void __devinit atl1e_check_options(struct atl1e_adapter *adapter) ...@@ -254,7 +259,7 @@ void __devinit atl1e_check_options(struct atl1e_adapter *adapter)
int val; int val;
if (num_media_type > bd) { if (num_media_type > bd) {
val = media_type[bd]; val = media_type[bd];
atl1e_validate_option(&val, &opt, pdev); atl1e_validate_option(&val, &opt, adapter);
adapter->hw.media_type = (u16) val; adapter->hw.media_type = (u16) val;
} else } else
adapter->hw.media_type = (u16)(opt.def); adapter->hw.media_type = (u16)(opt.def);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment