aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/atl1/atl1_param.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/atl1/atl1_param.c')
-rw-r--r--drivers/net/atl1/atl1_param.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/net/atl1/atl1_param.c b/drivers/net/atl1/atl1_param.c
index bcd0bd891722..324f9f0ece99 100644
--- a/drivers/net/atl1/atl1_param.c
+++ b/drivers/net/atl1/atl1_param.c
@@ -93,7 +93,7 @@ struct atl1_option {
93 } arg; 93 } arg;
94}; 94};
95 95
96static int __devinit atl1_validate_option(int *value, struct atl1_option *opt) 96static int __devinit atl1_validate_option(int *value, struct atl1_option *opt, struct pci_dev *pdev)
97{ 97{
98 if (*value == OPTION_UNSET) { 98 if (*value == OPTION_UNSET) {
99 *value = opt->def; 99 *value = opt->def;
@@ -104,19 +104,17 @@ static int __devinit atl1_validate_option(int *value, struct atl1_option *opt)
104 case enable_option: 104 case enable_option:
105 switch (*value) { 105 switch (*value) {
106 case OPTION_ENABLED: 106 case OPTION_ENABLED:
107 printk(KERN_INFO "%s: %s Enabled\n", atl1_driver_name, 107 dev_info(&pdev->dev, "%s enabled\n", opt->name);
108 opt->name);
109 return 0; 108 return 0;
110 case OPTION_DISABLED: 109 case OPTION_DISABLED:
111 printk(KERN_INFO "%s: %s Disabled\n", atl1_driver_name, 110 dev_info(&pdev->dev, "%s disabled\n", opt->name);
112 opt->name);
113 return 0; 111 return 0;
114 } 112 }
115 break; 113 break;
116 case range_option: 114 case range_option:
117 if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) { 115 if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
118 printk(KERN_INFO "%s: %s set to %i\n", 116 dev_info(&pdev->dev, "%s set to %i\n", opt->name,
119 atl1_driver_name, opt->name, *value); 117 *value);
120 return 0; 118 return 0;
121 } 119 }
122 break; 120 break;
@@ -128,8 +126,8 @@ static int __devinit atl1_validate_option(int *value, struct atl1_option *opt)
128 ent = &opt->arg.l.p[i]; 126 ent = &opt->arg.l.p[i];
129 if (*value == ent->i) { 127 if (*value == ent->i) {
130 if (ent->str[0] != '\0') 128 if (ent->str[0] != '\0')
131 printk(KERN_INFO "%s: %s\n", 129 dev_info(&pdev->dev, "%s\n",
132 atl1_driver_name, ent->str); 130 ent->str);
133 return 0; 131 return 0;
134 } 132 }
135 } 133 }
@@ -140,8 +138,8 @@ static int __devinit atl1_validate_option(int *value, struct atl1_option *opt)
140 break; 138 break;
141 } 139 }
142 140
143 printk(KERN_INFO "%s: invalid %s specified (%i) %s\n", 141 dev_info(&pdev->dev, "invalid %s specified (%i) %s\n",
144 atl1_driver_name, opt->name, *value, opt->err); 142 opt->name, *value, opt->err);
145 *value = opt->def; 143 *value = opt->def;
146 return -1; 144 return -1;
147} 145}
@@ -157,12 +155,11 @@ static int __devinit atl1_validate_option(int *value, struct atl1_option *opt)
157 */ 155 */
158void __devinit atl1_check_options(struct atl1_adapter *adapter) 156void __devinit atl1_check_options(struct atl1_adapter *adapter)
159{ 157{
158 struct pci_dev *pdev = adapter->pdev;
160 int bd = adapter->bd_number; 159 int bd = adapter->bd_number;
161 if (bd >= ATL1_MAX_NIC) { 160 if (bd >= ATL1_MAX_NIC) {
162 printk(KERN_NOTICE "%s: warning: no configuration for board #%i\n", 161 dev_notice(&pdev->dev, "no configuration for board#%i\n", bd);
163 atl1_driver_name, bd); 162 dev_notice(&pdev->dev, "using defaults for all values\n");
164 printk(KERN_NOTICE "%s: using defaults for all values\n",
165 atl1_driver_name);
166 } 163 }
167 { /* Interrupt Moderate Timer */ 164 { /* Interrupt Moderate Timer */
168 struct atl1_option opt = { 165 struct atl1_option opt = {
@@ -177,7 +174,7 @@ void __devinit atl1_check_options(struct atl1_adapter *adapter)
177 int val; 174 int val;
178 if (num_int_mod_timer > bd) { 175 if (num_int_mod_timer > bd) {
179 val = int_mod_timer[bd]; 176 val = int_mod_timer[bd];
180 atl1_validate_option(&val, &opt); 177 atl1_validate_option(&val, &opt, pdev);
181 adapter->imt = (u16) val; 178 adapter->imt = (u16) val;
182 } else 179 } else
183 adapter->imt = (u16) (opt.def); 180 adapter->imt = (u16) (opt.def);
@@ -197,7 +194,7 @@ void __devinit atl1_check_options(struct atl1_adapter *adapter)
197 int val; 194 int val;
198 if (num_flash_vendor > bd) { 195 if (num_flash_vendor > bd) {
199 val = flash_vendor[bd]; 196 val = flash_vendor[bd];
200 atl1_validate_option(&val, &opt); 197 atl1_validate_option(&val, &opt, pdev);
201 adapter->hw.flash_vendor = (u8) val; 198 adapter->hw.flash_vendor = (u8) val;
202 } else 199 } else
203 adapter->hw.flash_vendor = (u8) (opt.def); 200 adapter->hw.flash_vendor = (u8) (opt.def);