aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/3c589_cs.c
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/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)";
142 142
143/*====================================================================*/ 143/*====================================================================*/
144 144
145static void tc589_config(struct pcmcia_device *link); 145static int tc589_config(struct pcmcia_device *link);
146static void tc589_release(struct pcmcia_device *link); 146static void tc589_release(struct pcmcia_device *link);
147 147
148static u16 read_eeprom(kio_addr_t ioaddr, int index); 148static u16 read_eeprom(kio_addr_t ioaddr, int index);
@@ -170,7 +170,7 @@ static void tc589_detach(struct pcmcia_device *p_dev);
170 170
171======================================================================*/ 171======================================================================*/
172 172
173static int tc589_attach(struct pcmcia_device *link) 173static int tc589_probe(struct pcmcia_device *link)
174{ 174{
175 struct el3_private *lp; 175 struct el3_private *lp;
176 struct net_device *dev; 176 struct net_device *dev;
@@ -212,9 +212,7 @@ static int tc589_attach(struct pcmcia_device *link)
212 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); 212 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
213 213
214 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 214 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
215 tc589_config(link); 215 return tc589_config(link);
216
217 return 0;
218} /* tc589_attach */ 216} /* tc589_attach */
219 217
220/*====================================================================== 218/*======================================================================
@@ -252,7 +250,7 @@ static void tc589_detach(struct pcmcia_device *link)
252#define CS_CHECK(fn, ret) \ 250#define CS_CHECK(fn, ret) \
253do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 251do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
254 252
255static void tc589_config(struct pcmcia_device *link) 253static int tc589_config(struct pcmcia_device *link)
256{ 254{
257 struct net_device *dev = link->priv; 255 struct net_device *dev = link->priv;
258 struct el3_private *lp = netdev_priv(dev); 256 struct el3_private *lp = netdev_priv(dev);
@@ -359,14 +357,13 @@ static void tc589_config(struct pcmcia_device *link)
359 printk(KERN_INFO " %dK FIFO split %s Rx:Tx, %s xcvr\n", 357 printk(KERN_INFO " %dK FIFO split %s Rx:Tx, %s xcvr\n",
360 (fifo & 7) ? 32 : 8, ram_split[(fifo >> 16) & 3], 358 (fifo & 7) ? 32 : 8, ram_split[(fifo >> 16) & 3],
361 if_names[dev->if_port]); 359 if_names[dev->if_port]);
362 return; 360 return 0;
363 361
364cs_failed: 362cs_failed:
365 cs_error(link, last_fn, last_ret); 363 cs_error(link, last_fn, last_ret);
366failed: 364failed:
367 tc589_release(link); 365 tc589_release(link);
368 return; 366 return -ENODEV;
369
370} /* tc589_config */ 367} /* tc589_config */
371 368
372/*====================================================================== 369/*======================================================================
@@ -997,7 +994,7 @@ static struct pcmcia_driver tc589_driver = {
997 .drv = { 994 .drv = {
998 .name = "3c589_cs", 995 .name = "3c589_cs",
999 }, 996 },
1000 .probe = tc589_attach, 997 .probe = tc589_probe,
1001 .remove = tc589_detach, 998 .remove = tc589_detach,
1002 .id_table = tc589_ids, 999 .id_table = tc589_ids,
1003 .suspend = tc589_suspend, 1000 .suspend = tc589_suspend,