summaryrefslogtreecommitdiff
path: root/drivers/net/pcmcia/com20020_cs.c
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/net/pcmcia/com20020_cs.c
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/net/pcmcia/com20020_cs.c')
-rw-r--r--drivers/net/pcmcia/com20020_cs.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index a9bcfb4ba15e..a7d675bc6051 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -118,7 +118,7 @@ MODULE_LICENSE("GPL");
/*====================================================================*/
-static void com20020_config(struct pcmcia_device *link);
+static int com20020_config(struct pcmcia_device *link);
static void com20020_release(struct pcmcia_device *link);
static void com20020_detach(struct pcmcia_device *p_dev);
@@ -138,7 +138,7 @@ typedef struct com20020_dev_t {
======================================================================*/
-static int com20020_attach(struct pcmcia_device *p_dev)
+static int com20020_probe(struct pcmcia_device *p_dev)
{
com20020_dev_t *info;
struct net_device *dev;
@@ -179,9 +179,7 @@ static int com20020_attach(struct pcmcia_device *p_dev)
p_dev->priv = info;
p_dev->state |= DEV_PRESENT;
- com20020_config(p_dev);
-
- return 0;
+ return com20020_config(p_dev);
fail_alloc_dev:
kfree(info);
@@ -250,7 +248,7 @@ static void com20020_detach(struct pcmcia_device *link)
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-static void com20020_config(struct pcmcia_device *link)
+static int com20020_config(struct pcmcia_device *link)
{
struct arcnet_local *lp;
tuple_t tuple;
@@ -345,13 +343,14 @@ static void com20020_config(struct pcmcia_device *link)
DEBUG(1,KERN_INFO "%s: port %#3lx, irq %d\n",
dev->name, dev->base_addr, dev->irq);
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
failed:
DEBUG(1,"com20020_config failed...\n");
com20020_release(link);
+ return -ENODEV;
} /* com20020_config */
/*======================================================================
@@ -404,7 +403,7 @@ static struct pcmcia_driver com20020_cs_driver = {
.drv = {
.name = "com20020_cs",
},
- .probe = com20020_attach,
+ .probe = com20020_probe,
.remove = com20020_detach,
.id_table = com20020_ids,
.suspend = com20020_suspend,