diff options
Diffstat (limited to 'drivers/isdn/hisax/elsa_cs.c')
-rw-r--r-- | drivers/isdn/hisax/elsa_cs.c | 46 |
1 files changed, 11 insertions, 35 deletions
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c index f4d0fe29bcf8..a2f709f53974 100644 --- a/drivers/isdn/hisax/elsa_cs.c +++ b/drivers/isdn/hisax/elsa_cs.c | |||
@@ -57,23 +57,6 @@ MODULE_DESCRIPTION("ISDN4Linux: PCMCIA client driver for Elsa PCM cards"); | |||
57 | MODULE_AUTHOR("Klaus Lichtenwalder"); | 57 | MODULE_AUTHOR("Klaus Lichtenwalder"); |
58 | MODULE_LICENSE("Dual MPL/GPL"); | 58 | MODULE_LICENSE("Dual MPL/GPL"); |
59 | 59 | ||
60 | /* | ||
61 | All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If | ||
62 | you do not define PCMCIA_DEBUG at all, all the debug code will be | ||
63 | left out. If you compile with PCMCIA_DEBUG=0, the debug code will | ||
64 | be present but disabled -- but it can then be enabled for specific | ||
65 | modules at load time with a 'pc_debug=#' option to insmod. | ||
66 | */ | ||
67 | |||
68 | #ifdef PCMCIA_DEBUG | ||
69 | static int pc_debug = PCMCIA_DEBUG; | ||
70 | module_param(pc_debug, int, 0); | ||
71 | #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args); | ||
72 | static char *version = | ||
73 | "elsa_cs.c $Revision: 1.2.2.4 $ $Date: 2004/01/25 15:07:06 $ (K.Lichtenwalder)"; | ||
74 | #else | ||
75 | #define DEBUG(n, args...) | ||
76 | #endif | ||
77 | 60 | ||
78 | /*====================================================================*/ | 61 | /*====================================================================*/ |
79 | 62 | ||
@@ -142,7 +125,7 @@ static int elsa_cs_probe(struct pcmcia_device *link) | |||
142 | { | 125 | { |
143 | local_info_t *local; | 126 | local_info_t *local; |
144 | 127 | ||
145 | DEBUG(0, "elsa_cs_attach()\n"); | 128 | dev_dbg(&link->dev, "elsa_cs_attach()\n"); |
146 | 129 | ||
147 | /* Allocate space for private device-specific data */ | 130 | /* Allocate space for private device-specific data */ |
148 | local = kzalloc(sizeof(local_info_t), GFP_KERNEL); | 131 | local = kzalloc(sizeof(local_info_t), GFP_KERNEL); |
@@ -155,7 +138,6 @@ static int elsa_cs_probe(struct pcmcia_device *link) | |||
155 | 138 | ||
156 | /* Interrupt setup */ | 139 | /* Interrupt setup */ |
157 | link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; | 140 | link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; |
158 | link->irq.IRQInfo1 = IRQ_LEVEL_ID|IRQ_SHARE_ID; | ||
159 | link->irq.Handler = NULL; | 141 | link->irq.Handler = NULL; |
160 | 142 | ||
161 | /* | 143 | /* |
@@ -188,7 +170,7 @@ static void elsa_cs_detach(struct pcmcia_device *link) | |||
188 | { | 170 | { |
189 | local_info_t *info = link->priv; | 171 | local_info_t *info = link->priv; |
190 | 172 | ||
191 | DEBUG(0, "elsa_cs_detach(0x%p)\n", link); | 173 | dev_dbg(&link->dev, "elsa_cs_detach(0x%p)\n", link); |
192 | 174 | ||
193 | info->busy = 1; | 175 | info->busy = 1; |
194 | elsa_cs_release(link); | 176 | elsa_cs_release(link); |
@@ -231,30 +213,25 @@ static int elsa_cs_configcheck(struct pcmcia_device *p_dev, | |||
231 | static int elsa_cs_config(struct pcmcia_device *link) | 213 | static int elsa_cs_config(struct pcmcia_device *link) |
232 | { | 214 | { |
233 | local_info_t *dev; | 215 | local_info_t *dev; |
234 | int i, last_fn; | 216 | int i; |
235 | IsdnCard_t icard; | 217 | IsdnCard_t icard; |
236 | 218 | ||
237 | DEBUG(0, "elsa_config(0x%p)\n", link); | 219 | dev_dbg(&link->dev, "elsa_config(0x%p)\n", link); |
238 | dev = link->priv; | 220 | dev = link->priv; |
239 | 221 | ||
240 | i = pcmcia_loop_config(link, elsa_cs_configcheck, NULL); | 222 | i = pcmcia_loop_config(link, elsa_cs_configcheck, NULL); |
241 | if (i != 0) { | 223 | if (i != 0) |
242 | last_fn = RequestIO; | 224 | goto failed; |
243 | goto cs_failed; | ||
244 | } | ||
245 | 225 | ||
246 | i = pcmcia_request_irq(link, &link->irq); | 226 | i = pcmcia_request_irq(link, &link->irq); |
247 | if (i != 0) { | 227 | if (i != 0) { |
248 | link->irq.AssignedIRQ = 0; | 228 | link->irq.AssignedIRQ = 0; |
249 | last_fn = RequestIRQ; | 229 | goto failed; |
250 | goto cs_failed; | ||
251 | } | 230 | } |
252 | 231 | ||
253 | i = pcmcia_request_configuration(link, &link->conf); | 232 | i = pcmcia_request_configuration(link, &link->conf); |
254 | if (i != 0) { | 233 | if (i != 0) |
255 | last_fn = RequestConfiguration; | 234 | goto failed; |
256 | goto cs_failed; | ||
257 | } | ||
258 | 235 | ||
259 | /* At this point, the dev_node_t structure(s) should be | 236 | /* At this point, the dev_node_t structure(s) should be |
260 | initialized and arranged in a linked list at link->dev. *//* */ | 237 | initialized and arranged in a linked list at link->dev. *//* */ |
@@ -290,8 +267,7 @@ static int elsa_cs_config(struct pcmcia_device *link) | |||
290 | ((local_info_t*)link->priv)->cardnr = i; | 267 | ((local_info_t*)link->priv)->cardnr = i; |
291 | 268 | ||
292 | return 0; | 269 | return 0; |
293 | cs_failed: | 270 | failed: |
294 | cs_error(link, last_fn, i); | ||
295 | elsa_cs_release(link); | 271 | elsa_cs_release(link); |
296 | return -ENODEV; | 272 | return -ENODEV; |
297 | } /* elsa_cs_config */ | 273 | } /* elsa_cs_config */ |
@@ -308,7 +284,7 @@ static void elsa_cs_release(struct pcmcia_device *link) | |||
308 | { | 284 | { |
309 | local_info_t *local = link->priv; | 285 | local_info_t *local = link->priv; |
310 | 286 | ||
311 | DEBUG(0, "elsa_cs_release(0x%p)\n", link); | 287 | dev_dbg(&link->dev, "elsa_cs_release(0x%p)\n", link); |
312 | 288 | ||
313 | if (local) { | 289 | if (local) { |
314 | if (local->cardnr >= 0) { | 290 | if (local->cardnr >= 0) { |