atl1: minor cleanup
Subsystems (2)
cover atl1: minor cleanup
Please accept the following trivial patches to the atl1 driver.
- use dev_printk macros
- fix whitespace damage
drivers/net/atl1/atl1_ethtool.c | 19 +++------ drivers/net/atl1/atl1_hw.c | 44 ++++++++++----------- drivers/net/atl1/atl1_main.c | 83 +++++++++++++++++--------------------- drivers/net/atl1/atl1_param.c | 31 +++++++-------- 4 files changed, 79 insertions(+), 98 deletions(-)
PATCH 2/2 atl1: fix whitespace damage
Remove trailing whitespace and spaces preceding tabs.
Signed-off-by Jay Cliburn <[email protected]>
--- drivers/net/atl1/atl1_hw.c | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-)
drivers/net/atl1/atl1_hw.c +11 -11
@@ -2,20 +2,20 @@* Copyright(c) 2005 - 2006 Attansic Corporation. All rights reserved. * Copyright(c) 2006 Chris Snook <[email protected]> * Copyright(c) 2006 Jay Cliburn <[email protected]> -* +* * Derived from Intel e1000 driver * Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved. -* +* * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. -* +* * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. -* +* * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -42,9 +42,9 @@ s32 atl1_reset_hw(struct atl1_hw *hw)u32 icr;int i; -/* +/* * Clear Interrupt mask to stop board from generating -* interrupts & Clear any pending interrupt events +* interrupts & Clear any pending interrupt events */ /* * iowrite32(0, hw->hw_addr + REG_IMR);
@@ -137,8 +137,8 @@ s32 atl1_read_phy_reg(struct atl1_hw *hw, u16 reg_addr, u16 *phy_data)int i; val = ((u32) (reg_addr &MDIO_REG_ADDR_MASK )) <<MDIO_REG_ADDR_SHIFT | -MDIO_START |MDIO_SUP_PREAMBLE |MDIO_RW |MDIO_CLK_25_4 << -MDIO_CLK_SEL_SHIFT ; +MDIO_START |MDIO_SUP_PREAMBLE |MDIO_RW |MDIO_CLK_25_4 << +MDIO_CLK_SEL_SHIFT ;iowrite32 (val, hw->hw_addr +REG_MDIO_CTRL );ioread32 (hw->hw_addr +REG_MDIO_CTRL );
@@ -205,7 +205,7 @@ static bool atl1_spi_read(struct atl1_hw *hw, u32 addr, u32 *buf)/* * get_permanent_address -* return 0 if get valid mac address, +* return 0 if get valid mac address, */ static int atl1_get_permanent_address (struct atl1_hw *hw) {
@@ -302,7 +302,7 @@ static int atl1_get_permanent_address(struct atl1_hw *hw) }/* -* Reads the adapter's MAC address from the EEPROM +* Reads the adapter's MAC address from the EEPROM * hw - Struct containing variables accessed by shared code */ s32 atl1_read_mac_addr (struct atl1_hw *hw)
@@ -629,7 +629,7 @@ static void atl1_init_flash_opcode(struct atl1_hw *hw)* Performs basic configuration of the adapter. * hw - Struct containing variables accessed by shared code * Assumes that the controller has previously been reset and is in a -* post-reset uninitialized state. Initializes multicast table, +* post-reset uninitialized state. Initializes multicast table, * and Calls routines to setup link * Leaves the transmit and receive units disabled and uninitialized. */
Signature · 1 line
1.5.0.6
PATCH 1/2 atl1: use dev_printk macros
In reply to Jay CliburnUse dev_printk macros for PCI related errors, warnings, debug and info console messages.
Signed-off-by Jay Cliburn <[email protected]>
--- drivers/net/atl1/atl1_ethtool.c | 19 +++------ drivers/net/atl1/atl1_hw.c | 22 +++++------ drivers/net/atl1/atl1_main.c | 83 +++++++++++++++++--------------------- drivers/net/atl1/atl1_param.c | 31 +++++++-------- 4 files changed, 68 insertions(+), 87 deletions(-)
drivers/net/atl1/atl1_ethtool.c +7 -12
@@ -156,8 +156,7 @@ static int atl1_set_settings(struct net_device *netdev,u16 old_media_type = hw->media_type;if (netif_running (adapter->netdev)) { -printk (KERN_DEBUG "%s: ethtool shutting down adapter\n" , - atl1_driver_name); +dev_dbg (&adapter->pdev->dev,"ethtool shutting down adapter\n" );atl1_down (adapter); }
@@ -166,9 +165,8 @@ static int atl1_set_settings(struct net_device *netdev,else {if (ecmd->speed ==SPEED_1000 ) {if (ecmd->duplex !=DUPLEX_FULL ) { -printk (KERN_WARNING -"%s: can't force to 1000M half duplex\n" , - atl1_driver_name); +dev_warn (&adapter->pdev->dev, +"can't force to 1000M half duplex\n" ); ret_val = -EINVAL ; goto exit_sset; }
@@ -206,9 +204,8 @@ static int atl1_set_settings(struct net_device *netdev, }if (atl1_phy_setup_autoneg_adv (hw)) { ret_val = -EINVAL ; -printk (KERN_WARNING -"%s: invalid ethtool speed/duplex setting\n" , - atl1_driver_name); +dev_warn (&adapter->pdev->dev, +"invalid ethtool speed/duplex setting\n" ); goto exit_sset; } if (hw->media_type == MEDIA_TYPE_AUTO_SENSOR ||
@@ -239,12 +236,10 @@ exit_sset: hw->media_type = old_media_type;if (netif_running (adapter->netdev)) { -printk (KERN_DEBUG "%s: ethtool starting adapter\n" , - atl1_driver_name); +dev_dbg (&adapter->pdev->dev,"ethtool starting adapter\n" );atl1_up (adapter); }else if (!ret_val) { -printk (KERN_DEBUG "%s: ethtool resetting adapter\n" , - atl1_driver_name); +dev_dbg (&adapter->pdev->dev,"ethtool resetting adapter\n" );atl1_reset (adapter); }return ret_val;
drivers/net/atl1/atl1_hw.c +10 -12
@@ -38,6 +38,7 @@*/ s32 atl1_reset_hw (struct atl1_hw *hw) { +struct pci_dev *pdev = hw->back->pdev;u32 icr;int i;
@@ -74,7 +75,7 @@ s32 atl1_reset_hw(struct atl1_hw *hw) }if (icr) { -printk (KERN_DEBUG "icr = %x\n" , icr); +dev_dbg (&pdev->dev,"ICR = 0x%x\n" , icr);return icr; }
@@ -437,6 +438,7 @@ s32 atl1_phy_enter_power_saving(struct atl1_hw *hw)*/ static s32 atl1_phy_reset (struct atl1_hw *hw) { +struct pci_dev *pdev = hw->back->pdev;s32 ret_val;u16 phy_data;
@@ -468,8 +470,7 @@ static s32 atl1_phy_reset(struct atl1_hw *hw)u32 val;int i;/* pcie serdes link may be down! */ -printk (KERN_DEBUG "%s: autoneg caused pcie phy link down\n" , - atl1_driver_name); +dev_dbg (&pdev->dev,"pcie phy link down\n" );for (i =0 ; i <25 ; i++) {msleep (1 );
@@ -479,9 +480,7 @@ static s32 atl1_phy_reset(struct atl1_hw *hw) }if ((val & (MDIO_START |MDIO_BUSY )) !=0 ) { -printk (KERN_WARNING -"%s: pcie link down at least for 25ms\n" , - atl1_driver_name); +dev_warn (&pdev->dev,"pcie link down at least 25ms\n" );return ret_val; } }
@@ -571,6 +570,7 @@ s32 atl1_phy_setup_autoneg_adv(struct atl1_hw *hw)*/ static s32 atl1_setup_link (struct atl1_hw *hw) { +struct pci_dev *pdev = hw->back->pdev;s32 ret_val;/*
@@ -581,15 +581,13 @@ static s32 atl1_setup_link(struct atl1_hw *hw)*/ ret_val =atl1_phy_setup_autoneg_adv (hw);if (ret_val) { -printk (KERN_DEBUG "%s: error setting up autonegotiation\n" , - atl1_driver_name); +dev_dbg (&pdev->dev,"error setting up autonegotiation\n" );return ret_val; }/* SW.Reset , En-Auto-Neg if needed */ ret_val =atl1_phy_reset (hw);if (ret_val) { -printk (KERN_DEBUG "%s: error resetting the phy\n" , - atl1_driver_name); +dev_dbg (&pdev->dev,"error resetting phy\n" );return ret_val; } hw->phy_configured = true;
@@ -669,6 +667,7 @@ s32 atl1_init_hw(struct atl1_hw *hw)*/ s32 atl1_get_speed_and_duplex (struct atl1_hw *hw,u16 *speed,u16 *duplex) { +struct pci_dev *pdev = hw->back->pdev;s32 ret_val;u16 phy_data;
@@ -691,8 +690,7 @@ s32 atl1_get_speed_and_duplex(struct atl1_hw *hw, u16 *speed, u16 *duplex) *speed =SPEED_10 ;break ;default : -printk (KERN_DEBUG "%s: error getting speed\n" , - atl1_driver_name); +dev_dbg (&pdev->dev,"error getting speed\n" );return ATL1_ERR_PHY_SPEED ;break ; }
drivers/net/atl1/atl1_main.c +37 -46
196 lines not on this page · raw message
drivers/net/atl1/atl1_param.c +14 -17
@@ -94,7 +94,7 @@ struct atl1_option { } arg; }; -static int __devinit atl1_validate_option (int *value,struct atl1_option *opt) +static int __devinit atl1_validate_option (int *value,struct atl1_option *opt,struct pci_dev *pdev) {if (*value ==OPTION_UNSET ) { *value = opt->def;
@@ -105,19 +105,17 @@ static int __devinit atl1_validate_option(int *value, struct atl1_option *opt)case enable_option:switch (*value) {case OPTION_ENABLED : -printk (KERN_INFO "%s: %s Enabled\n" , atl1_driver_name, - opt->name); +dev_info (&pdev->dev,"%s enabled\n" , opt->name);return 0 ;case OPTION_DISABLED : -printk (KERN_INFO "%s: %s Disabled\n" , atl1_driver_name, - opt->name); +dev_info (&pdev->dev,"%s disabled\n" , opt->name);return 0 ; }break ;case range_option:if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) { -printk (KERN_INFO "%s: %s set to %i\n" , - atl1_driver_name, opt->name, *value); +dev_info (&pdev->dev,"%s set to %i\n" , opt->name, + *value);return 0 ; }break ;
@@ -129,8 +127,8 @@ static int __devinit atl1_validate_option(int *value, struct atl1_option *opt) ent = &opt->arg.l.p[i];if (*value == ent->i) {if (ent->str[0 ] !='\0' ) -printk (KERN_INFO "%s: %s\n" , - atl1_driver_name, ent->str); +dev_info (&pdev->dev,"%s\n" , + ent->str);return 0 ; } }
@@ -141,8 +139,8 @@ static int __devinit atl1_validate_option(int *value, struct atl1_option *opt)break ; } -printk (KERN_INFO "%s: invalid %s specified (%i) %s\n" , - atl1_driver_name, opt->name, *value, opt->err); +dev_info (&pdev->dev,"invalid %s specified (%i) %s\n" , + opt->name, *value, opt->err); *value = opt->def;return -1 ; }
@@ -158,12 +156,11 @@ static int __devinit atl1_validate_option(int *value, struct atl1_option *opt)*/ void __devinit atl1_check_options (struct atl1_adapter *adapter) { +struct pci_dev *pdev = adapter->pdev;int bd = adapter->bd_number;if (bd >=ATL1_MAX_NIC ) { -printk (KERN_NOTICE "%s: warning: no configuration for board #%i\n" , - atl1_driver_name, bd); -printk (KERN_NOTICE "%s: using defaults for all values\n" , - atl1_driver_name); +dev_notice (&pdev->dev,"no configuration for board#%i\n" , bd); +dev_notice (&pdev->dev,"using defaults for all values\n" ); } {/* Interrupt Moderate Timer */ struct atl1_option opt = {
@@ -178,7 +175,7 @@ void __devinit atl1_check_options(struct atl1_adapter *adapter)int val;if (num_int_mod_timer > bd) { val = int_mod_timer[bd]; -atl1_validate_option (&val, &opt); +atl1_validate_option (&val, &opt, pdev); adapter->imt = (u16 ) val; }else adapter->imt = (u16) (opt.def);
@@ -198,7 +195,7 @@ void __devinit atl1_check_options(struct atl1_adapter *adapter)int val;if (num_flash_vendor > bd) { val = flash_vendor[bd]; -atl1_validate_option (&val, &opt); +atl1_validate_option (&val, &opt, pdev); adapter->hw.flash_vendor = (u8 ) val; }else adapter->hw.flash_vendor = (u8) (opt.def);
Signature · 1 line
1.5.0.6
Quoted 4 lines · Jay Cliburn
Please accept the following trivial patches to the atl1 driver.
- use
dev_printkmacros
- fix whitespace damage
Acked-by Chris Snook <[email protected]>
Re: [PATCH 1/2] atl1: use dev_printk macros
In reply to Jay CliburnQuoted 10 lines · Jay Cliburn
Use
dev_printkmacros for PCI related errors, warnings, debug and info console messages.Signed-off-by Jay Cliburn <[email protected]>--- drivers/net/atl1/atl1_ethtool.c | 19 +++------ drivers/net/atl1/atl1_hw.c | 22 +++++------ drivers/net/atl1/atl1_main.c | 83 +++++++++++++++++--------------------- drivers/net/atl1/atl1_param.c | 31 +++++++-------- 4 files changed, 68 insertions(+), 87 deletions(-)
applied 1-2