summaryrefslogtreecommitdiff
path: root/drivers/net/pcmcia/3c589_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/3c589_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/3c589_cs.c')
-rw-r--r--drivers/net/pcmcia/3c589_cs.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 565063d49334..160d48a8ed88 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -142,7 +142,7 @@ DRV_NAME ".c " DRV_VERSION " 2001/10/13 00:08:50 (David Hinds)";
/*====================================================================*/
-static void tc589_config(struct pcmcia_device *link);
+static int tc589_config(struct pcmcia_device *link);
static void tc589_release(struct pcmcia_device *link);
static u16 read_eeprom(kio_addr_t ioaddr, int index);
@@ -170,7 +170,7 @@ static void tc589_detach(struct pcmcia_device *p_dev);
======================================================================*/
-static int tc589_attach(struct pcmcia_device *link)
+static int tc589_probe(struct pcmcia_device *link)
{
struct el3_private *lp;
struct net_device *dev;
@@ -212,9 +212,7 @@ static int tc589_attach(struct pcmcia_device *link)
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- tc589_config(link);
-
- return 0;
+ return tc589_config(link);
} /* tc589_attach */
/*======================================================================
@@ -252,7 +250,7 @@ static void tc589_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 tc589_config(struct pcmcia_device *link)
+static int tc589_config(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
struct el3_private *lp = netdev_priv(dev);
@@ -359,14 +357,13 @@ static void tc589_config(struct pcmcia_device *link)
printk(KERN_INFO " %dK FIFO split %s Rx:Tx, %s xcvr\n",
(fifo & 7) ? 32 : 8, ram_split[(fifo >> 16) & 3],
if_names[dev->if_port]);
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
failed:
tc589_release(link);
- return;
-
+ return -ENODEV;
} /* tc589_config */
/*======================================================================
@@ -997,7 +994,7 @@ static struct pcmcia_driver tc589_driver = {
.drv = {
.name = "3c589_cs",
},
- .probe = tc589_attach,
+ .probe = tc589_probe,
.remove = tc589_detach,
.id_table = tc589_ids,
.suspend = tc589_suspend,