aboutsummaryrefslogtreecommitdiff
path: root/drivers/isdn/hardware
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 17:26:06 +0200
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 17:26:06 +0200
commit15b99ac1729503db9e6dc642a50b9b6cb3bf51f9 (patch)
treecfb8897487beba502aac2b28bc35066a87e34299 /drivers/isdn/hardware
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')
-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 c9c794e2926..28f9211726c 100644
--- a/drivers/isdn/hardware/avm/avm_cs.c
+++ b/drivers/isdn/hardware/avm/avm_cs.c
@@ -51,7 +51,7 @@ MODULE_LICENSE("GPL");
handler.
*/
-static void avmcs_config(struct pcmcia_device *link);
+static int avmcs_config(struct pcmcia_device *link);
static void avmcs_release(struct pcmcia_device *link);
/*
@@ -99,7 +99,7 @@ typedef struct local_info_t {
======================================================================*/
-static int avmcs_attach(struct pcmcia_device *p_dev)
+static int avmcs_probe(struct pcmcia_device *p_dev)
{
local_info_t *local;
@@ -128,12 +128,10 @@ static int avmcs_attach(struct pcmcia_device *p_dev)
p_dev->priv = local;
p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- avmcs_config(p_dev);
-
- return 0;
+ return avmcs_config(p_dev);
err:
- return -EINVAL;
+ return -ENOMEM;
} /* avmcs_attach */
/*======================================================================
@@ -185,7 +183,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple,
return get_tuple(handle, tuple, parse);
}
-static void avmcs_config(struct pcmcia_device *link)
+static int avmcs_config(struct pcmcia_device *link)
{
tuple_t tuple;
cisparse_t parse;
@@ -219,7 +217,7 @@ static void avmcs_config(struct pcmcia_device *link)
if (i != CS_SUCCESS) {
cs_error(link, ParseTuple, i);
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return -ENODEV;
}
/* Configure card */
@@ -319,7 +317,7 @@ found_port:
/* If any step failed, release any partially configured state */
if (i != 0) {
avmcs_release(link);
- return;
+ return -ENODEV;
}
@@ -333,9 +331,10 @@ found_port:
printk(KERN_ERR "avm_cs: failed to add AVM-%s-Controller at i/o %#x, irq %d\n",
dev->node.dev_name, link->io.BasePort1, link->irq.AssignedIRQ);
avmcs_release(link);
- return;
+ return -ENODEV;
}
dev->node.minor = i;
+ return 0;
} /* avmcs_config */
@@ -367,7 +366,7 @@ static struct pcmcia_driver avmcs_driver = {
.drv = {
.name = "avm_cs",
},
- .probe = avmcs_attach,
+ .probe = avmcs_probe,
.remove = avmcs_detach,
.id_table = avmcs_ids,
};