aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hardware/avm
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:26:06 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:26:06 -0500
commit15b99ac1729503db9e6dc642a50b9b6cb3bf51f9 (patch)
treecfb8897487beba502aac2b28bc35066a87e34299 /drivers/isdn/hardware/avm
parentfba395eee7d3f342ca739c20f5b3ee635d0420a0 (diff)
[PATCH] pcmcia: add return value to _config() functions
Most of the driver initialization isn't done in the .probe function, but in the internal _config() functions. Make them return a value, so that .probe can properly report whether the probing of the device succeeded or not. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/isdn/hardware/avm')
-rw-r--r--drivers/isdn/hardware/avm/avm_cs.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c
index c9c794e2926d..28f9211726c5 100644
--- a/drivers/isdn/hardware/avm/avm_cs.c
+++ b/drivers/isdn/hardware/avm/avm_cs.c
@@ -51,7 +51,7 @@ MODULE_LICENSE("GPL");
51 handler. 51 handler.
52*/ 52*/
53 53
54static void avmcs_config(struct pcmcia_device *link); 54static int avmcs_config(struct pcmcia_device *link);
55static void avmcs_release(struct pcmcia_device *link); 55static void avmcs_release(struct pcmcia_device *link);
56 56
57/* 57/*
@@ -99,7 +99,7 @@ typedef struct local_info_t {
99 99
100======================================================================*/ 100======================================================================*/
101 101
102static int avmcs_attach(struct pcmcia_device *p_dev) 102static int avmcs_probe(struct pcmcia_device *p_dev)
103{ 103{
104 local_info_t *local; 104 local_info_t *local;
105 105
@@ -128,12 +128,10 @@ static int avmcs_attach(struct pcmcia_device *p_dev)
128 p_dev->priv = local; 128 p_dev->priv = local;
129 129
130 p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 130 p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
131 avmcs_config(p_dev); 131 return avmcs_config(p_dev);
132
133 return 0;
134 132
135 err: 133 err:
136 return -EINVAL; 134 return -ENOMEM;
137} /* avmcs_attach */ 135} /* avmcs_attach */
138 136
139/*====================================================================== 137/*======================================================================
@@ -185,7 +183,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple,
185 return get_tuple(handle, tuple, parse); 183 return get_tuple(handle, tuple, parse);
186} 184}
187 185
188static void avmcs_config(struct pcmcia_device *link) 186static int avmcs_config(struct pcmcia_device *link)
189{ 187{
190 tuple_t tuple; 188 tuple_t tuple;
191 cisparse_t parse; 189 cisparse_t parse;
@@ -219,7 +217,7 @@ static void avmcs_config(struct pcmcia_device *link)
219 if (i != CS_SUCCESS) { 217 if (i != CS_SUCCESS) {
220 cs_error(link, ParseTuple, i); 218 cs_error(link, ParseTuple, i);
221 link->state &= ~DEV_CONFIG_PENDING; 219 link->state &= ~DEV_CONFIG_PENDING;
222 return; 220 return -ENODEV;
223 } 221 }
224 222
225 /* Configure card */ 223 /* Configure card */
@@ -319,7 +317,7 @@ found_port:
319 /* If any step failed, release any partially configured state */ 317 /* If any step failed, release any partially configured state */
320 if (i != 0) { 318 if (i != 0) {
321 avmcs_release(link); 319 avmcs_release(link);
322 return; 320 return -ENODEV;
323 } 321 }
324 322
325 323
@@ -333,9 +331,10 @@ found_port:
333 printk(KERN_ERR "avm_cs: failed to add AVM-%s-Controller at i/o %#x, irq %d\n", 331 printk(KERN_ERR "avm_cs: failed to add AVM-%s-Controller at i/o %#x, irq %d\n",
334 dev->node.dev_name, link->io.BasePort1, link->irq.AssignedIRQ); 332 dev->node.dev_name, link->io.BasePort1, link->irq.AssignedIRQ);
335 avmcs_release(link); 333 avmcs_release(link);
336 return; 334 return -ENODEV;
337 } 335 }
338 dev->node.minor = i; 336 dev->node.minor = i;
337 return 0;
339 338
340} /* avmcs_config */ 339} /* avmcs_config */
341 340
@@ -367,7 +366,7 @@ static struct pcmcia_driver avmcs_driver = {
367 .drv = { 366 .drv = {
368 .name = "avm_cs", 367 .name = "avm_cs",
369 }, 368 },
370 .probe = avmcs_attach, 369 .probe = avmcs_probe,
371 .remove = avmcs_detach, 370 .remove = avmcs_detach,
372 .id_table = avmcs_ids, 371 .id_table = avmcs_ids,
373}; 372};