aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/airo_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2009-10-24 09:53:36 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2009-11-09 02:30:02 -0500
commit2caff14713d53abba273e6095495788e2720f756 (patch)
treed22eeea544d7a746a8c107322602d0da77450dff /drivers/net/wireless/airo_cs.c
parent624dd66957e53e15cf40e937b50597c4d41f0e99 (diff)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (wireless)
Convert PCMCIA drivers to use the dynamic debug infrastructure, instead of requiring manual settings of PCMCIA_DEBUG. Also, remove all usages of the CS_CHECK macro and replace them with proper Linux style calling and return value checking. The extra error reporting may be dropped, as the PCMCIA core already complains about any (non-driver-author) errors. CC: linux-wireless@vger.kernel.org CC: netdev@vger.kernel.org Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/wireless/airo_cs.c')
-rw-r--r--drivers/net/wireless/airo_cs.c48
1 files changed, 16 insertions, 32 deletions
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index d0593ed9170e..a1b84fc48afd 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -43,21 +43,6 @@
43 43
44#include "airo.h" 44#include "airo.h"
45 45
46/*
47 All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
48 you do not define PCMCIA_DEBUG at all, all the debug code will be
49 left out. If you compile with PCMCIA_DEBUG=0, the debug code will
50 be present but disabled -- but it can then be enabled for specific
51 modules at load time with a 'pc_debug=#' option to insmod.
52*/
53#ifdef PCMCIA_DEBUG
54static int pc_debug = PCMCIA_DEBUG;
55module_param(pc_debug, int, 0);
56static char *version = "$Revision: 1.2 $";
57#define DEBUG(n, args...) if (pc_debug > (n)) printk(KERN_DEBUG args);
58#else
59#define DEBUG(n, args...)
60#endif
61 46
62/*====================================================================*/ 47/*====================================================================*/
63 48
@@ -145,7 +130,7 @@ static int airo_probe(struct pcmcia_device *p_dev)
145{ 130{
146 local_info_t *local; 131 local_info_t *local;
147 132
148 DEBUG(0, "airo_attach()\n"); 133 dev_dbg(&p_dev->dev, "airo_attach()\n");
149 134
150 /* Interrupt setup */ 135 /* Interrupt setup */
151 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 136 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
@@ -184,7 +169,7 @@ static int airo_probe(struct pcmcia_device *p_dev)
184 169
185static void airo_detach(struct pcmcia_device *link) 170static void airo_detach(struct pcmcia_device *link)
186{ 171{
187 DEBUG(0, "airo_detach(0x%p)\n", link); 172 dev_dbg(&link->dev, "airo_detach\n");
188 173
189 airo_release(link); 174 airo_release(link);
190 175
@@ -204,9 +189,6 @@ static void airo_detach(struct pcmcia_device *link)
204 189
205 ======================================================================*/ 190 ======================================================================*/
206 191
207#define CS_CHECK(fn, ret) \
208do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
209
210static int airo_cs_config_check(struct pcmcia_device *p_dev, 192static int airo_cs_config_check(struct pcmcia_device *p_dev,
211 cistpl_cftable_entry_t *cfg, 193 cistpl_cftable_entry_t *cfg,
212 cistpl_cftable_entry_t *dflt, 194 cistpl_cftable_entry_t *dflt,
@@ -291,11 +273,11 @@ static int airo_config(struct pcmcia_device *link)
291{ 273{
292 local_info_t *dev; 274 local_info_t *dev;
293 win_req_t *req; 275 win_req_t *req;
294 int last_fn, last_ret; 276 int ret;
295 277
296 dev = link->priv; 278 dev = link->priv;
297 279
298 DEBUG(0, "airo_config(0x%p)\n", link); 280 dev_dbg(&link->dev, "airo_config\n");
299 281
300 req = kzalloc(sizeof(win_req_t), GFP_KERNEL); 282 req = kzalloc(sizeof(win_req_t), GFP_KERNEL);
301 if (!req) 283 if (!req)
@@ -315,8 +297,8 @@ static int airo_config(struct pcmcia_device *link)
315 * and most client drivers will only use the CIS to fill in 297 * and most client drivers will only use the CIS to fill in
316 * implementation-defined details. 298 * implementation-defined details.
317 */ 299 */
318 last_ret = pcmcia_loop_config(link, airo_cs_config_check, req); 300 ret = pcmcia_loop_config(link, airo_cs_config_check, req);
319 if (last_ret) 301 if (ret)
320 goto failed; 302 goto failed;
321 303
322 /* 304 /*
@@ -324,21 +306,25 @@ static int airo_config(struct pcmcia_device *link)
324 handler to the interrupt, unless the 'Handler' member of the 306 handler to the interrupt, unless the 'Handler' member of the
325 irq structure is initialized. 307 irq structure is initialized.
326 */ 308 */
327 if (link->conf.Attributes & CONF_ENABLE_IRQ) 309 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
328 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 310 ret = pcmcia_request_irq(link, &link->irq);
311 if (ret)
312 goto failed;
313 }
329 314
330 /* 315 /*
331 This actually configures the PCMCIA socket -- setting up 316 This actually configures the PCMCIA socket -- setting up
332 the I/O windows and the interrupt mapping, and putting the 317 the I/O windows and the interrupt mapping, and putting the
333 card and host interface into "Memory and IO" mode. 318 card and host interface into "Memory and IO" mode.
334 */ 319 */
335 CS_CHECK(RequestConfiguration, 320 ret = pcmcia_request_configuration(link, &link->conf);
336 pcmcia_request_configuration(link, &link->conf)); 321 if (ret)
322 goto failed;
337 ((local_info_t *)link->priv)->eth_dev = 323 ((local_info_t *)link->priv)->eth_dev =
338 init_airo_card(link->irq.AssignedIRQ, 324 init_airo_card(link->irq.AssignedIRQ,
339 link->io.BasePort1, 1, &handle_to_dev(link)); 325 link->io.BasePort1, 1, &handle_to_dev(link));
340 if (!((local_info_t *)link->priv)->eth_dev) 326 if (!((local_info_t *)link->priv)->eth_dev)
341 goto cs_failed; 327 goto failed;
342 328
343 /* 329 /*
344 At this point, the dev_node_t structure(s) need to be 330 At this point, the dev_node_t structure(s) need to be
@@ -368,8 +354,6 @@ static int airo_config(struct pcmcia_device *link)
368 kfree(req); 354 kfree(req);
369 return 0; 355 return 0;
370 356
371 cs_failed:
372 cs_error(link, last_fn, last_ret);
373 failed: 357 failed:
374 airo_release(link); 358 airo_release(link);
375 kfree(req); 359 kfree(req);
@@ -386,7 +370,7 @@ static int airo_config(struct pcmcia_device *link)
386 370
387static void airo_release(struct pcmcia_device *link) 371static void airo_release(struct pcmcia_device *link)
388{ 372{
389 DEBUG(0, "airo_release(0x%p)\n", link); 373 dev_dbg(&link->dev, "airo_release\n");
390 pcmcia_disable_device(link); 374 pcmcia_disable_device(link);
391} 375}
392 376