aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/pcmcia/ipwireless/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/pcmcia/ipwireless/main.c')
-rw-r--r--drivers/char/pcmcia/ipwireless/main.c54
1 files changed, 22 insertions, 32 deletions
diff --git a/drivers/char/pcmcia/ipwireless/main.c b/drivers/char/pcmcia/ipwireless/main.c
index 5eca7a99afe6..5216fce0c62d 100644
--- a/drivers/char/pcmcia/ipwireless/main.c
+++ b/drivers/char/pcmcia/ipwireless/main.c
@@ -65,9 +65,9 @@ static void signalled_reboot_work(struct work_struct *work_reboot)
65 struct ipw_dev *ipw = container_of(work_reboot, struct ipw_dev, 65 struct ipw_dev *ipw = container_of(work_reboot, struct ipw_dev,
66 work_reboot); 66 work_reboot);
67 struct pcmcia_device *link = ipw->link; 67 struct pcmcia_device *link = ipw->link;
68 int ret = pccard_reset_card(link->socket); 68 int ret = pcmcia_reset_card(link->socket);
69 69
70 if (ret != CS_SUCCESS) 70 if (ret != 0)
71 cs_error(link, ResetCard, ret); 71 cs_error(link, ResetCard, ret);
72} 72}
73 73
@@ -83,7 +83,6 @@ static int config_ipwireless(struct ipw_dev *ipw)
83{ 83{
84 struct pcmcia_device *link = ipw->link; 84 struct pcmcia_device *link = ipw->link;
85 int ret; 85 int ret;
86 config_info_t conf;
87 tuple_t tuple; 86 tuple_t tuple;
88 unsigned short buf[64]; 87 unsigned short buf[64];
89 cisparse_t parse; 88 cisparse_t parse;
@@ -105,7 +104,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
105 while (ret == 0) { 104 while (ret == 0) {
106 ret = pcmcia_get_tuple_data(link, &tuple); 105 ret = pcmcia_get_tuple_data(link, &tuple);
107 106
108 if (ret != CS_SUCCESS) { 107 if (ret != 0) {
109 cs_error(link, GetTupleData, ret); 108 cs_error(link, GetTupleData, ret);
110 goto exit0; 109 goto exit0;
111 } 110 }
@@ -116,21 +115,21 @@ static int config_ipwireless(struct ipw_dev *ipw)
116 115
117 ret = pcmcia_get_first_tuple(link, &tuple); 116 ret = pcmcia_get_first_tuple(link, &tuple);
118 117
119 if (ret != CS_SUCCESS) { 118 if (ret != 0) {
120 cs_error(link, GetFirstTuple, ret); 119 cs_error(link, GetFirstTuple, ret);
121 goto exit0; 120 goto exit0;
122 } 121 }
123 122
124 ret = pcmcia_get_tuple_data(link, &tuple); 123 ret = pcmcia_get_tuple_data(link, &tuple);
125 124
126 if (ret != CS_SUCCESS) { 125 if (ret != 0) {
127 cs_error(link, GetTupleData, ret); 126 cs_error(link, GetTupleData, ret);
128 goto exit0; 127 goto exit0;
129 } 128 }
130 129
131 ret = pcmcia_parse_tuple(link, &tuple, &parse); 130 ret = pcmcia_parse_tuple(&tuple, &parse);
132 131
133 if (ret != CS_SUCCESS) { 132 if (ret != 0) {
134 cs_error(link, ParseTuple, ret); 133 cs_error(link, ParseTuple, ret);
135 goto exit0; 134 goto exit0;
136 } 135 }
@@ -152,21 +151,21 @@ static int config_ipwireless(struct ipw_dev *ipw)
152 151
153 ret = pcmcia_get_first_tuple(link, &tuple); 152 ret = pcmcia_get_first_tuple(link, &tuple);
154 153
155 if (ret != CS_SUCCESS) { 154 if (ret != 0) {
156 cs_error(link, GetFirstTuple, ret); 155 cs_error(link, GetFirstTuple, ret);
157 goto exit0; 156 goto exit0;
158 } 157 }
159 158
160 ret = pcmcia_get_tuple_data(link, &tuple); 159 ret = pcmcia_get_tuple_data(link, &tuple);
161 160
162 if (ret != CS_SUCCESS) { 161 if (ret != 0) {
163 cs_error(link, GetTupleData, ret); 162 cs_error(link, GetTupleData, ret);
164 goto exit0; 163 goto exit0;
165 } 164 }
166 165
167 ret = pcmcia_parse_tuple(link, &tuple, &parse); 166 ret = pcmcia_parse_tuple(&tuple, &parse);
168 167
169 if (ret != CS_SUCCESS) { 168 if (ret != 0) {
170 cs_error(link, GetTupleData, ret); 169 cs_error(link, GetTupleData, ret);
171 goto exit0; 170 goto exit0;
172 } 171 }
@@ -181,7 +180,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
181 180
182 ret = pcmcia_request_io(link, &link->io); 181 ret = pcmcia_request_io(link, &link->io);
183 182
184 if (ret != CS_SUCCESS) { 183 if (ret != 0) {
185 cs_error(link, RequestIO, ret); 184 cs_error(link, RequestIO, ret);
186 goto exit0; 185 goto exit0;
187 } 186 }
@@ -195,21 +194,21 @@ static int config_ipwireless(struct ipw_dev *ipw)
195 194
196 ret = pcmcia_get_first_tuple(link, &tuple); 195 ret = pcmcia_get_first_tuple(link, &tuple);
197 196
198 if (ret != CS_SUCCESS) { 197 if (ret != 0) {
199 cs_error(link, GetFirstTuple, ret); 198 cs_error(link, GetFirstTuple, ret);
200 goto exit1; 199 goto exit1;
201 } 200 }
202 201
203 ret = pcmcia_get_tuple_data(link, &tuple); 202 ret = pcmcia_get_tuple_data(link, &tuple);
204 203
205 if (ret != CS_SUCCESS) { 204 if (ret != 0) {
206 cs_error(link, GetTupleData, ret); 205 cs_error(link, GetTupleData, ret);
207 goto exit1; 206 goto exit1;
208 } 207 }
209 208
210 ret = pcmcia_parse_tuple(link, &tuple, &parse); 209 ret = pcmcia_parse_tuple(&tuple, &parse);
211 210
212 if (ret != CS_SUCCESS) { 211 if (ret != 0) {
213 cs_error(link, ParseTuple, ret); 212 cs_error(link, ParseTuple, ret);
214 goto exit1; 213 goto exit1;
215 } 214 }
@@ -227,7 +226,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
227 ret = pcmcia_request_window(&link, &ipw->request_common_memory, 226 ret = pcmcia_request_window(&link, &ipw->request_common_memory,
228 &ipw->handle_common_memory); 227 &ipw->handle_common_memory);
229 228
230 if (ret != CS_SUCCESS) { 229 if (ret != 0) {
231 cs_error(link, RequestWindow, ret); 230 cs_error(link, RequestWindow, ret);
232 goto exit1; 231 goto exit1;
233 } 232 }
@@ -239,7 +238,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
239 ret = pcmcia_map_mem_page(ipw->handle_common_memory, 238 ret = pcmcia_map_mem_page(ipw->handle_common_memory,
240 &memreq_common_memory); 239 &memreq_common_memory);
241 240
242 if (ret != CS_SUCCESS) { 241 if (ret != 0) {
243 cs_error(link, MapMemPage, ret); 242 cs_error(link, MapMemPage, ret);
244 goto exit1; 243 goto exit1;
245 } 244 }
@@ -261,7 +260,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
261 ret = pcmcia_request_window(&link, &ipw->request_attr_memory, 260 ret = pcmcia_request_window(&link, &ipw->request_attr_memory,
262 &ipw->handle_attr_memory); 261 &ipw->handle_attr_memory);
263 262
264 if (ret != CS_SUCCESS) { 263 if (ret != 0) {
265 cs_error(link, RequestWindow, ret); 264 cs_error(link, RequestWindow, ret);
266 goto exit2; 265 goto exit2;
267 } 266 }
@@ -272,7 +271,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
272 ret = pcmcia_map_mem_page(ipw->handle_attr_memory, 271 ret = pcmcia_map_mem_page(ipw->handle_attr_memory,
273 &memreq_attr_memory); 272 &memreq_attr_memory);
274 273
275 if (ret != CS_SUCCESS) { 274 if (ret != 0) {
276 cs_error(link, MapMemPage, ret); 275 cs_error(link, MapMemPage, ret);
277 goto exit2; 276 goto exit2;
278 } 277 }
@@ -292,20 +291,11 @@ static int config_ipwireless(struct ipw_dev *ipw)
292 291
293 ret = pcmcia_request_irq(link, &link->irq); 292 ret = pcmcia_request_irq(link, &link->irq);
294 293
295 if (ret != CS_SUCCESS) { 294 if (ret != 0) {
296 cs_error(link, RequestIRQ, ret); 295 cs_error(link, RequestIRQ, ret);
297 goto exit3; 296 goto exit3;
298 } 297 }
299 298
300 /* Look up current Vcc */
301
302 ret = pcmcia_get_configuration_info(link, &conf);
303
304 if (ret != CS_SUCCESS) {
305 cs_error(link, GetConfigurationInfo, ret);
306 goto exit4;
307 }
308
309 printk(KERN_INFO IPWIRELESS_PCCARD_NAME ": Card type %s\n", 299 printk(KERN_INFO IPWIRELESS_PCCARD_NAME ": Card type %s\n",
310 ipw->is_v2_card ? "V2/V3" : "V1"); 300 ipw->is_v2_card ? "V2/V3" : "V1");
311 printk(KERN_INFO IPWIRELESS_PCCARD_NAME 301 printk(KERN_INFO IPWIRELESS_PCCARD_NAME
@@ -341,7 +331,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
341 */ 331 */
342 ret = pcmcia_request_configuration(link, &link->conf); 332 ret = pcmcia_request_configuration(link, &link->conf);
343 333
344 if (ret != CS_SUCCESS) { 334 if (ret != 0) {
345 cs_error(link, RequestConfiguration, ret); 335 cs_error(link, RequestConfiguration, ret);
346 goto exit4; 336 goto exit4;
347 } 337 }