diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-10-24 09:50:13 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-11-09 02:29:59 -0500 |
commit | e773cfe167c320d07b9423bc51fc4ab0221775a4 (patch) | |
tree | e27b0b26b2c55c629100edaa73c7429ed7d41ee9 /drivers/isdn/hisax/teles_cs.c | |
parent | cbf624f0e18c4a05219855663a3e5f9fe8f2d876 (diff) |
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (isdn)
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: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/isdn/hisax/teles_cs.c')
-rw-r--r-- | drivers/isdn/hisax/teles_cs.c | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c index 623d111544d4..7b11c15b3a97 100644 --- a/drivers/isdn/hisax/teles_cs.c +++ b/drivers/isdn/hisax/teles_cs.c | |||
@@ -38,23 +38,6 @@ MODULE_DESCRIPTION("ISDN4Linux: PCMCIA client driver for Teles PCMCIA cards"); | |||
38 | MODULE_AUTHOR("Christof Petig, christof.petig@wtal.de, Karsten Keil, kkeil@suse.de"); | 38 | MODULE_AUTHOR("Christof Petig, christof.petig@wtal.de, Karsten Keil, kkeil@suse.de"); |
39 | MODULE_LICENSE("GPL"); | 39 | MODULE_LICENSE("GPL"); |
40 | 40 | ||
41 | /* | ||
42 | All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If | ||
43 | you do not define PCMCIA_DEBUG at all, all the debug code will be | ||
44 | left out. If you compile with PCMCIA_DEBUG=0, the debug code will | ||
45 | be present but disabled -- but it can then be enabled for specific | ||
46 | modules at load time with a 'pc_debug=#' option to insmod. | ||
47 | */ | ||
48 | |||
49 | #ifdef PCMCIA_DEBUG | ||
50 | static int pc_debug = PCMCIA_DEBUG; | ||
51 | module_param(pc_debug, int, 0); | ||
52 | #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args); | ||
53 | static char *version = | ||
54 | "teles_cs.c 2.10 2002/07/30 22:23:34 kkeil"; | ||
55 | #else | ||
56 | #define DEBUG(n, args...) | ||
57 | #endif | ||
58 | 41 | ||
59 | /*====================================================================*/ | 42 | /*====================================================================*/ |
60 | 43 | ||
@@ -133,7 +116,7 @@ static int teles_probe(struct pcmcia_device *link) | |||
133 | { | 116 | { |
134 | local_info_t *local; | 117 | local_info_t *local; |
135 | 118 | ||
136 | DEBUG(0, "teles_attach()\n"); | 119 | dev_dbg(&link->dev, "teles_attach()\n"); |
137 | 120 | ||
138 | /* Allocate space for private device-specific data */ | 121 | /* Allocate space for private device-specific data */ |
139 | local = kzalloc(sizeof(local_info_t), GFP_KERNEL); | 122 | local = kzalloc(sizeof(local_info_t), GFP_KERNEL); |
@@ -178,7 +161,7 @@ static void teles_detach(struct pcmcia_device *link) | |||
178 | { | 161 | { |
179 | local_info_t *info = link->priv; | 162 | local_info_t *info = link->priv; |
180 | 163 | ||
181 | DEBUG(0, "teles_detach(0x%p)\n", link); | 164 | dev_dbg(&link->dev, "teles_detach(0x%p)\n", link); |
182 | 165 | ||
183 | info->busy = 1; | 166 | info->busy = 1; |
184 | teles_cs_release(link); | 167 | teles_cs_release(link); |
@@ -221,30 +204,25 @@ static int teles_cs_configcheck(struct pcmcia_device *p_dev, | |||
221 | static int teles_cs_config(struct pcmcia_device *link) | 204 | static int teles_cs_config(struct pcmcia_device *link) |
222 | { | 205 | { |
223 | local_info_t *dev; | 206 | local_info_t *dev; |
224 | int i, last_fn; | 207 | int i; |
225 | IsdnCard_t icard; | 208 | IsdnCard_t icard; |
226 | 209 | ||
227 | DEBUG(0, "teles_config(0x%p)\n", link); | 210 | dev_dbg(&link->dev, "teles_config(0x%p)\n", link); |
228 | dev = link->priv; | 211 | dev = link->priv; |
229 | 212 | ||
230 | i = pcmcia_loop_config(link, teles_cs_configcheck, NULL); | 213 | i = pcmcia_loop_config(link, teles_cs_configcheck, NULL); |
231 | if (i != 0) { | 214 | if (i != 0) |
232 | last_fn = RequestIO; | ||
233 | goto cs_failed; | 215 | goto cs_failed; |
234 | } | ||
235 | 216 | ||
236 | i = pcmcia_request_irq(link, &link->irq); | 217 | i = pcmcia_request_irq(link, &link->irq); |
237 | if (i != 0) { | 218 | if (i != 0) { |
238 | link->irq.AssignedIRQ = 0; | 219 | link->irq.AssignedIRQ = 0; |
239 | last_fn = RequestIRQ; | ||
240 | goto cs_failed; | 220 | goto cs_failed; |
241 | } | 221 | } |
242 | 222 | ||
243 | i = pcmcia_request_configuration(link, &link->conf); | 223 | i = pcmcia_request_configuration(link, &link->conf); |
244 | if (i != 0) { | 224 | if (i != 0) |
245 | last_fn = RequestConfiguration; | ||
246 | goto cs_failed; | 225 | goto cs_failed; |
247 | } | ||
248 | 226 | ||
249 | /* At this point, the dev_node_t structure(s) should be | 227 | /* At this point, the dev_node_t structure(s) should be |
250 | initialized and arranged in a linked list at link->dev. *//* */ | 228 | initialized and arranged in a linked list at link->dev. *//* */ |
@@ -283,7 +261,6 @@ static int teles_cs_config(struct pcmcia_device *link) | |||
283 | return 0; | 261 | return 0; |
284 | 262 | ||
285 | cs_failed: | 263 | cs_failed: |
286 | cs_error(link, last_fn, i); | ||
287 | teles_cs_release(link); | 264 | teles_cs_release(link); |
288 | return -ENODEV; | 265 | return -ENODEV; |
289 | } /* teles_cs_config */ | 266 | } /* teles_cs_config */ |
@@ -300,7 +277,7 @@ static void teles_cs_release(struct pcmcia_device *link) | |||
300 | { | 277 | { |
301 | local_info_t *local = link->priv; | 278 | local_info_t *local = link->priv; |
302 | 279 | ||
303 | DEBUG(0, "teles_cs_release(0x%p)\n", link); | 280 | dev_dbg(&link->dev, "teles_cs_release(0x%p)\n", link); |
304 | 281 | ||
305 | if (local) { | 282 | if (local) { |
306 | if (local->cardnr >= 0) { | 283 | if (local->cardnr >= 0) { |