diff options
author | Joe Perches <joe@perches.com> | 2010-02-09 06:49:48 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-12 16:27:44 -0500 |
commit | ba211e3ec35820eced89bfe12e2d94e6352a4c5f (patch) | |
tree | 997d133bb18f347534b7a70536b693cd2a9843a1 /drivers/net/atl1e/atl1e_param.c | |
parent | 571ba42303813106d533bf6bda929d8e289f51bf (diff) |
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: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/atl1e/atl1e_param.c')
-rw-r--r-- | drivers/net/atl1e/atl1e_param.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/drivers/net/atl1e/atl1e_param.c b/drivers/net/atl1e/atl1e_param.c index b3be59fd3fb5..0ce60b6e7ef0 100644 --- a/drivers/net/atl1e/atl1e_param.c +++ b/drivers/net/atl1e/atl1e_param.c | |||
@@ -116,7 +116,7 @@ struct atl1e_option { | |||
116 | } arg; | 116 | } arg; |
117 | }; | 117 | }; |
118 | 118 | ||
119 | static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt, struct pci_dev *pdev) | 119 | static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt, struct atl1e_adapter *adapter) |
120 | { | 120 | { |
121 | if (*value == OPTION_UNSET) { | 121 | if (*value == OPTION_UNSET) { |
122 | *value = opt->def; | 122 | *value = opt->def; |
@@ -127,16 +127,19 @@ static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt, | |||
127 | case enable_option: | 127 | case enable_option: |
128 | switch (*value) { | 128 | switch (*value) { |
129 | case OPTION_ENABLED: | 129 | case OPTION_ENABLED: |
130 | dev_info(&pdev->dev, "%s Enabled\n", opt->name); | 130 | netdev_info(adapter->netdev, |
131 | "%s Enabled\n", opt->name); | ||
131 | return 0; | 132 | return 0; |
132 | case OPTION_DISABLED: | 133 | case OPTION_DISABLED: |
133 | dev_info(&pdev->dev, "%s Disabled\n", opt->name); | 134 | netdev_info(adapter->netdev, |
135 | "%s Disabled\n", opt->name); | ||
134 | return 0; | 136 | return 0; |
135 | } | 137 | } |
136 | break; | 138 | break; |
137 | case range_option: | 139 | case range_option: |
138 | if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) { | 140 | if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) { |
139 | dev_info(&pdev->dev, "%s set to %i\n", opt->name, *value); | 141 | netdev_info(adapter->netdev, "%s set to %i\n", |
142 | opt->name, *value); | ||
140 | return 0; | 143 | return 0; |
141 | } | 144 | } |
142 | break; | 145 | break; |
@@ -148,8 +151,8 @@ static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt, | |||
148 | ent = &opt->arg.l.p[i]; | 151 | ent = &opt->arg.l.p[i]; |
149 | if (*value == ent->i) { | 152 | if (*value == ent->i) { |
150 | if (ent->str[0] != '\0') | 153 | if (ent->str[0] != '\0') |
151 | dev_info(&pdev->dev, "%s\n", | 154 | netdev_info(adapter->netdev, |
152 | ent->str); | 155 | "%s\n", ent->str); |
153 | return 0; | 156 | return 0; |
154 | } | 157 | } |
155 | } | 158 | } |
@@ -159,8 +162,8 @@ static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt, | |||
159 | BUG(); | 162 | BUG(); |
160 | } | 163 | } |
161 | 164 | ||
162 | dev_info(&pdev->dev, "Invalid %s specified (%i) %s\n", | 165 | netdev_info(adapter->netdev, "Invalid %s specified (%i) %s\n", |
163 | opt->name, *value, opt->err); | 166 | opt->name, *value, opt->err); |
164 | *value = opt->def; | 167 | *value = opt->def; |
165 | return -1; | 168 | return -1; |
166 | } | 169 | } |
@@ -176,11 +179,13 @@ static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt, | |||
176 | */ | 179 | */ |
177 | void __devinit atl1e_check_options(struct atl1e_adapter *adapter) | 180 | void __devinit atl1e_check_options(struct atl1e_adapter *adapter) |
178 | { | 181 | { |
179 | struct pci_dev *pdev = adapter->pdev; | ||
180 | int bd = adapter->bd_number; | 182 | int bd = adapter->bd_number; |
183 | |||
181 | if (bd >= ATL1E_MAX_NIC) { | 184 | if (bd >= ATL1E_MAX_NIC) { |
182 | dev_notice(&pdev->dev, "no configuration for board #%i\n", bd); | 185 | netdev_notice(adapter->netdev, |
183 | dev_notice(&pdev->dev, "Using defaults for all values\n"); | 186 | "no configuration for board #%i\n", bd); |
187 | netdev_notice(adapter->netdev, | ||
188 | "Using defaults for all values\n"); | ||
184 | } | 189 | } |
185 | 190 | ||
186 | { /* Transmit Ring Size */ | 191 | { /* Transmit Ring Size */ |
@@ -196,7 +201,7 @@ void __devinit atl1e_check_options(struct atl1e_adapter *adapter) | |||
196 | int val; | 201 | int val; |
197 | if (num_tx_desc_cnt > bd) { | 202 | if (num_tx_desc_cnt > bd) { |
198 | val = tx_desc_cnt[bd]; | 203 | val = tx_desc_cnt[bd]; |
199 | atl1e_validate_option(&val, &opt, pdev); | 204 | atl1e_validate_option(&val, &opt, adapter); |
200 | adapter->tx_ring.count = (u16) val & 0xFFFC; | 205 | adapter->tx_ring.count = (u16) val & 0xFFFC; |
201 | } else | 206 | } else |
202 | adapter->tx_ring.count = (u16)opt.def; | 207 | adapter->tx_ring.count = (u16)opt.def; |
@@ -215,7 +220,7 @@ void __devinit atl1e_check_options(struct atl1e_adapter *adapter) | |||
215 | int val; | 220 | int val; |
216 | if (num_rx_mem_size > bd) { | 221 | if (num_rx_mem_size > bd) { |
217 | val = rx_mem_size[bd]; | 222 | val = rx_mem_size[bd]; |
218 | atl1e_validate_option(&val, &opt, pdev); | 223 | atl1e_validate_option(&val, &opt, adapter); |
219 | adapter->rx_ring.page_size = (u32)val * 1024; | 224 | adapter->rx_ring.page_size = (u32)val * 1024; |
220 | } else { | 225 | } else { |
221 | adapter->rx_ring.page_size = (u32)opt.def * 1024; | 226 | adapter->rx_ring.page_size = (u32)opt.def * 1024; |
@@ -235,7 +240,7 @@ void __devinit atl1e_check_options(struct atl1e_adapter *adapter) | |||
235 | int val; | 240 | int val; |
236 | if (num_int_mod_timer > bd) { | 241 | if (num_int_mod_timer > bd) { |
237 | val = int_mod_timer[bd]; | 242 | val = int_mod_timer[bd]; |
238 | atl1e_validate_option(&val, &opt, pdev); | 243 | atl1e_validate_option(&val, &opt, adapter); |
239 | adapter->hw.imt = (u16) val; | 244 | adapter->hw.imt = (u16) val; |
240 | } else | 245 | } else |
241 | adapter->hw.imt = (u16)(opt.def); | 246 | adapter->hw.imt = (u16)(opt.def); |
@@ -254,7 +259,7 @@ void __devinit atl1e_check_options(struct atl1e_adapter *adapter) | |||
254 | int val; | 259 | int val; |
255 | if (num_media_type > bd) { | 260 | if (num_media_type > bd) { |
256 | val = media_type[bd]; | 261 | val = media_type[bd]; |
257 | atl1e_validate_option(&val, &opt, pdev); | 262 | atl1e_validate_option(&val, &opt, adapter); |
258 | adapter->hw.media_type = (u16) val; | 263 | adapter->hw.media_type = (u16) val; |
259 | } else | 264 | } else |
260 | adapter->hw.media_type = (u16)(opt.def); | 265 | adapter->hw.media_type = (u16)(opt.def); |