} bluecard_info_t;
-static void bluecard_config(struct pcmcia_device *link);
+static int bluecard_config(struct pcmcia_device *link);
static void bluecard_release(struct pcmcia_device *link);
static void bluecard_detach(struct pcmcia_device *p_dev);
return 0;
}
-static int bluecard_attach(struct pcmcia_device *link)
+static int bluecard_probe(struct pcmcia_device *link)
{
bluecard_info_t *info;
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- bluecard_config(link);
-
- return 0;
+ return bluecard_config(link);
}
return pcmcia_parse_tuple(handle, tuple, parse);
}
-static void bluecard_config(struct pcmcia_device *link)
+static int bluecard_config(struct pcmcia_device *link)
{
bluecard_info_t *info = link->priv;
tuple_t tuple;
link->dev_node = &info->node;
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
failed:
bluecard_release(link);
+ return -ENODEV;
}
.drv = {
.name = "bluecard_cs",
},
- .probe = bluecard_attach,
+ .probe = bluecard_probe,
.remove = bluecard_detach,
.id_table = bluecard_ids,
};
} bt3c_info_t;
-static void bt3c_config(struct pcmcia_device *link);
+static int bt3c_config(struct pcmcia_device *link);
static void bt3c_release(struct pcmcia_device *link);
static void bt3c_detach(struct pcmcia_device *p_dev);
return 0;
}
-static int bt3c_attach(struct pcmcia_device *link)
+static int bt3c_probe(struct pcmcia_device *link)
{
bt3c_info_t *info;
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- bt3c_config(link);
-
- return 0;
+ return bt3c_config(link);
}
return get_tuple(handle, tuple, parse);
}
-static void bt3c_config(struct pcmcia_device *link)
+static int bt3c_config(struct pcmcia_device *link)
{
static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
bt3c_info_t *info = link->priv;
link->dev_node = &info->node;
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
failed:
bt3c_release(link);
+ return -ENODEV;
}
.drv = {
.name = "bt3c_cs",
},
- .probe = bt3c_attach,
+ .probe = bt3c_probe,
.remove = bt3c_detach,
.id_table = bt3c_ids,
};
} btuart_info_t;
-static void btuart_config(struct pcmcia_device *link);
+static int btuart_config(struct pcmcia_device *link);
static void btuart_release(struct pcmcia_device *link);
static void btuart_detach(struct pcmcia_device *p_dev);
return 0;
}
-static int btuart_attach(struct pcmcia_device *link)
+static int btuart_probe(struct pcmcia_device *link)
{
btuart_info_t *info;
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- btuart_config(link);
-
- return 0;
+ return btuart_config(link);
}
return get_tuple(handle, tuple, parse);
}
-static void btuart_config(struct pcmcia_device *link)
+static int btuart_config(struct pcmcia_device *link)
{
static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
btuart_info_t *info = link->priv;
link->dev_node = &info->node;
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
failed:
btuart_release(link);
+ return -ENODEV;
}
.drv = {
.name = "btuart_cs",
},
- .probe = btuart_attach,
+ .probe = btuart_probe,
.remove = btuart_detach,
.id_table = btuart_ids,
};
} dtl1_info_t;
-static void dtl1_config(struct pcmcia_device *link);
+static int dtl1_config(struct pcmcia_device *link);
static void dtl1_release(struct pcmcia_device *link);
static void dtl1_detach(struct pcmcia_device *p_dev);
return 0;
}
-static int dtl1_attach(struct pcmcia_device *link)
+static int dtl1_probe(struct pcmcia_device *link)
{
dtl1_info_t *info;
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- dtl1_config(link);
-
- return 0;
+ return dtl1_config(link);
}
return get_tuple(handle, tuple, parse);
}
-static void dtl1_config(struct pcmcia_device *link)
+static int dtl1_config(struct pcmcia_device *link)
{
dtl1_info_t *info = link->priv;
tuple_t tuple;
link->dev_node = &info->node;
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
failed:
dtl1_release(link);
+ return -ENODEV;
}
.drv = {
.name = "dtl1_cs",
},
- .probe = dtl1_attach,
+ .probe = dtl1_probe,
.remove = dtl1_detach,
.id_table = dtl1_ids,
};
/*==== Interface to PCMCIA Layer =======================================*/
-static void cm4000_config(struct pcmcia_device * link, int devno)
+static int cm4000_config(struct pcmcia_device * link, int devno)
{
struct cm4000_dev *dev;
tuple_t tuple;
link->dev_node = &dev->node;
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return 0;
cs_failed:
cs_error(link, fail_fn, fail_rc);
cm4000_release(link);
link->state &= ~DEV_CONFIG_PENDING;
+ return -ENODEV;
}
static int cm4000_suspend(struct pcmcia_device *link)
pcmcia_disable_device(link);
}
-static int cm4000_attach(struct pcmcia_device *link)
+static int cm4000_probe(struct pcmcia_device *link)
{
struct cm4000_dev *dev;
- int i;
+ int i, ret;
for (i = 0; i < CM4000_MAX_DEV; i++)
if (dev_table[i] == NULL)
init_waitqueue_head(&dev->readq);
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- cm4000_config(link, i);
+ ret = cm4000_config(link, i);
+ if (ret)
+ return ret;
class_device_create(cmm_class, NULL, MKDEV(major, i), NULL,
"cmm%d", i);
.drv = {
.name = "cm4000_cs",
},
- .probe = cm4000_attach,
+ .probe = cm4000_probe,
.remove = cm4000_detach,
.suspend = cm4000_suspend,
.resume = cm4000_resume,
return;
}
-static void reader_config(struct pcmcia_device *link, int devno)
+static int reader_config(struct pcmcia_device *link, int devno)
{
struct reader_dev *dev;
tuple_t tuple;
link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1);
DEBUGP(2, dev, "<- reader_config (succ)\n");
- return;
+ return 0;
cs_failed:
cs_error(link, fail_fn, fail_rc);
cs_release:
reader_release(link);
link->state &= ~DEV_CONFIG_PENDING;
+ return -ENODEV;
}
static void reader_release(struct pcmcia_device *link)
pcmcia_disable_device(link);
}
-static int reader_attach(struct pcmcia_device *link)
+static int reader_probe(struct pcmcia_device *link)
{
struct reader_dev *dev;
- int i;
+ int i, ret;
for (i = 0; i < CM_MAX_DEV; i++) {
if (dev_table[i] == NULL)
dev->poll_timer.function = &cm4040_do_poll;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- reader_config(link, i);
+ ret = reader_config(link, i);
+ if (ret)
+ return ret;
class_device_create(cmx_class, NULL, MKDEV(major, i), NULL,
"cmx%d", i);
.drv = {
.name = "cm4040_cs",
},
- .probe = reader_attach,
+ .probe = reader_probe,
.remove = reader_detach,
.id_table = cm4040_ids,
};
/* PCMCIA prototypes */
-static void mgslpc_config(struct pcmcia_device *link);
+static int mgslpc_config(struct pcmcia_device *link);
static void mgslpc_release(u_long arg);
static void mgslpc_detach(struct pcmcia_device *p_dev);
}
}
-static int mgslpc_attach(struct pcmcia_device *link)
+static int mgslpc_probe(struct pcmcia_device *link)
{
MGSLPC_INFO *info;
+ int ret;
if (debug_level >= DEBUG_LEVEL_INFO)
printk("mgslpc_attach\n");
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- mgslpc_config(link);
+ ret = mgslpc_config(link);
+ if (ret)
+ return ret;
mgslpc_add_device(info);
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-static void mgslpc_config(struct pcmcia_device *link)
+static int mgslpc_config(struct pcmcia_device *link)
{
MGSLPC_INFO *info = link->priv;
tuple_t tuple;
printk("\n");
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
mgslpc_release((u_long)link);
+ return -ENODEV;
}
/* Card has been removed.
.drv = {
.name = "synclink_cs",
},
- .probe = mgslpc_attach,
+ .probe = mgslpc_probe,
.remove = mgslpc_detach,
.id_table = mgslpc_ids,
.suspend = mgslpc_suspend,
} ide_info_t;
static void ide_release(struct pcmcia_device *);
-static void ide_config(struct pcmcia_device *);
+static int ide_config(struct pcmcia_device *);
static void ide_detach(struct pcmcia_device *p_dev);
======================================================================*/
-static int ide_attach(struct pcmcia_device *link)
+static int ide_probe(struct pcmcia_device *link)
{
ide_info_t *info;
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- ide_config(link);
-
- return 0;
+ return ide_config(link);
} /* ide_attach */
/*======================================================================
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-static void ide_config(struct pcmcia_device *link)
+static int ide_config(struct pcmcia_device *link)
{
ide_info_t *info = link->priv;
tuple_t tuple;
link->state &= ~DEV_CONFIG_PENDING;
kfree(stk);
- return;
+ return 0;
err_mem:
printk(KERN_NOTICE "ide-cs: ide_config failed memory allocation\n");
kfree(stk);
ide_release(link);
link->state &= ~DEV_CONFIG_PENDING;
+ return -ENODEV;
} /* ide_config */
/*======================================================================
.drv = {
.name = "ide-cs",
},
- .probe = ide_attach,
+ .probe = ide_probe,
.remove = ide_detach,
.id_table = ide_ids,
};
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);
/*
======================================================================*/
-static int avmcs_attach(struct pcmcia_device *p_dev)
+static int avmcs_probe(struct pcmcia_device *p_dev)
{
local_info_t *local;
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 */
/*======================================================================
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;
if (i != CS_SUCCESS) {
cs_error(link, ParseTuple, i);
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return -ENODEV;
}
/* Configure card */
/* If any step failed, release any partially configured state */
if (i != 0) {
avmcs_release(link);
- return;
+ return -ENODEV;
}
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 */
.drv = {
.name = "avm_cs",
},
- .probe = avmcs_attach,
+ .probe = avmcs_probe,
.remove = avmcs_detach,
.id_table = avmcs_ids,
};
handler.
*/
-static void avma1cs_config(struct pcmcia_device *link);
+static int avma1cs_config(struct pcmcia_device *link);
static void avma1cs_release(struct pcmcia_device *link);
/*
======================================================================*/
-static int avma1cs_attach(struct pcmcia_device *p_dev)
+static int avma1cs_probe(struct pcmcia_device *p_dev)
{
local_info_t *local;
p_dev->conf.Present = PRESENT_OPTION;
p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- avma1cs_config(p_dev);
-
- return 0;
+ return avma1cs_config(p_dev);
} /* avma1cs_attach */
/*======================================================================
return get_tuple(handle, tuple, parse);
}
-static void avma1cs_config(struct pcmcia_device *link)
+static int avma1cs_config(struct pcmcia_device *link)
{
tuple_t tuple;
cisparse_t parse;
if (i != CS_SUCCESS) {
cs_error(link, ParseTuple, i);
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return -ENODEV;
}
/* Configure card */
/* If any step failed, release any partially configured state */
if (i != 0) {
avma1cs_release(link);
- return;
+ return -ENODEV;
}
printk(KERN_NOTICE "avma1_cs: checking at i/o %#x, irq %d\n",
if (i < 0) {
printk(KERN_ERR "avma1_cs: failed to initialize AVM A1 PCMCIA %d at i/o %#x\n", i, link->io.BasePort1);
avma1cs_release(link);
- return;
+ return -ENODEV;
}
dev->node.minor = i;
+ return 0;
} /* avma1cs_config */
/*======================================================================
.drv = {
.name = "avma1_cs",
},
- .probe = avma1cs_attach,
+ .probe = avma1cs_probe,
.remove = avma1cs_detach,
.id_table = avma1cs_ids,
};
handler.
*/
-static void elsa_cs_config(struct pcmcia_device *link);
+static int elsa_cs_config(struct pcmcia_device *link);
static void elsa_cs_release(struct pcmcia_device *link);
/*
======================================================================*/
-static int elsa_cs_attach(struct pcmcia_device *link)
+static int elsa_cs_probe(struct pcmcia_device *link)
{
local_info_t *local;
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- elsa_cs_config(link);
-
- return 0;
+ return elsa_cs_config(link);
} /* elsa_cs_attach */
/*======================================================================
return get_tuple(handle, tuple, parse);
}
-static void elsa_cs_config(struct pcmcia_device *link)
+static int elsa_cs_config(struct pcmcia_device *link)
{
tuple_t tuple;
cisparse_t parse;
} else
((local_info_t*)link->priv)->cardnr = i;
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, i);
elsa_cs_release(link);
+ return -ENODEV;
} /* elsa_cs_config */
/*======================================================================
.drv = {
.name = "elsa_cs",
},
- .probe = elsa_cs_attach,
+ .probe = elsa_cs_probe,
.remove = elsa_cs_detach,
.id_table = elsa_ids,
.suspend = elsa_suspend,
event handler.
*/
-static void sedlbauer_config(struct pcmcia_device *link);
+static int sedlbauer_config(struct pcmcia_device *link);
static void sedlbauer_release(struct pcmcia_device *link);
/*
======================================================================*/
-static int sedlbauer_attach(struct pcmcia_device *link)
+static int sedlbauer_probe(struct pcmcia_device *link)
{
local_info_t *local;
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- sedlbauer_config(link);
-
- return 0;
+ return sedlbauer_config(link);
} /* sedlbauer_attach */
/*======================================================================
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-static void sedlbauer_config(struct pcmcia_device *link)
+static int sedlbauer_config(struct pcmcia_device *link)
{
local_info_t *dev = link->priv;
tuple_t tuple;
printk(KERN_ERR "sedlbauer_cs: failed to initialize SEDLBAUER PCMCIA %d at i/o %#x\n",
last_ret, link->io.BasePort1);
sedlbauer_release(link);
+ return -ENODEV;
} else
((local_info_t*)link->priv)->cardnr = last_ret;
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
sedlbauer_release(link);
+ return -ENODEV;
} /* sedlbauer_config */
.drv = {
.name = "sedlbauer_cs",
},
- .probe = sedlbauer_attach,
+ .probe = sedlbauer_probe,
.remove = sedlbauer_detach,
.id_table = sedlbauer_ids,
.suspend = sedlbauer_suspend,
handler.
*/
-static void teles_cs_config(struct pcmcia_device *link);
+static int teles_cs_config(struct pcmcia_device *link);
static void teles_cs_release(struct pcmcia_device *link);
/*
======================================================================*/
-static int teles_attach(struct pcmcia_device *link)
+static int teles_probe(struct pcmcia_device *link)
{
local_info_t *local;
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- teles_cs_config(link);
-
- return 0;
+ return teles_cs_config(link);
} /* teles_attach */
/*======================================================================
return get_tuple(handle, tuple, parse);
}
-static void teles_cs_config(struct pcmcia_device *link)
+static int teles_cs_config(struct pcmcia_device *link)
{
tuple_t tuple;
cisparse_t parse;
printk(KERN_ERR "teles_cs: failed to initialize Teles PCMCIA %d at i/o %#x\n",
i, link->io.BasePort1);
teles_cs_release(link);
- } else
- ((local_info_t*)link->priv)->cardnr = i;
+ return -ENODEV;
+ }
+
+ ((local_info_t*)link->priv)->cardnr = i;
+ return 0;
- return;
cs_failed:
cs_error(link, last_fn, i);
teles_cs_release(link);
+ return -ENODEV;
} /* teles_cs_config */
/*======================================================================
.drv = {
.name = "teles_cs",
},
- .probe = teles_attach,
+ .probe = teles_probe,
.remove = teles_detach,
.id_table = teles_ids,
.suspend = teles_suspend,
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-static void pcmciamtd_config(struct pcmcia_device *link)
+static int pcmciamtd_config(struct pcmcia_device *link)
{
struct pcmciamtd_dev *dev = link->priv;
struct mtd_info *mtd = NULL;
if(!dev->win_size) {
err("Cant allocate memory window");
pcmciamtd_release(link);
- return;
+ return -ENODEV;
}
DEBUG(1, "Allocated a window of %dKiB", dev->win_size >> 10);
if(!dev->win_base) {
err("ioremap(%lu, %u) failed", req.Base, req.Size);
pcmciamtd_release(link);
- return;
+ return -ENODEV;
}
DEBUG(1, "mapped window dev = %p req.base = 0x%lx base = %p size = 0x%x",
dev, req.Base, dev->win_base, req.Size);
ret = pcmcia_request_configuration(link, &link->conf);
if(ret != CS_SUCCESS) {
cs_error(link, RequestConfiguration, ret);
+ return -ENODEV;
}
if(mem_type == 1) {
if(!mtd) {
DEBUG(1, "Cant find an MTD");
pcmciamtd_release(link);
- return;
+ return -ENODEV;
}
dev->mtd_info = mtd;
dev->mtd_info = NULL;
err("Couldnt register MTD device");
pcmciamtd_release(link);
- return;
+ return -ENODEV;
}
snprintf(dev->node.dev_name, sizeof(dev->node.dev_name), "mtd%d", mtd->index);
info("mtd%d: %s", mtd->index, mtd->name);
link->state &= ~DEV_CONFIG_PENDING;
link->dev_node = &dev->node;
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
err("CS Error, exiting");
pcmciamtd_release(link);
- return;
+ return -ENODEV;
}
* with Card Services.
*/
-static int pcmciamtd_attach(struct pcmcia_device *link)
+static int pcmciamtd_probe(struct pcmcia_device *link)
{
struct pcmciamtd_dev *dev;
link->conf.IntType = INT_MEMORY;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- pcmciamtd_config(link);
-
- return 0;
+ return pcmciamtd_config(link);
}
static struct pcmcia_device_id pcmciamtd_ids[] = {
.drv = {
.name = "pcmciamtd"
},
- .probe = pcmciamtd_attach,
+ .probe = pcmciamtd_probe,
.remove = pcmciamtd_detach,
.owner = THIS_MODULE,
.id_table = pcmciamtd_ids,
/* Index of functions. */
-static void tc574_config(struct pcmcia_device *link);
+static int tc574_config(struct pcmcia_device *link);
static void tc574_release(struct pcmcia_device *link);
static void mdio_sync(kio_addr_t ioaddr, int bits);
with Card Services.
*/
-static int tc574_attach(struct pcmcia_device *link)
+static int tc574_probe(struct pcmcia_device *link)
{
struct el3_private *lp;
struct net_device *dev;
#endif
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- tc574_config(link);
-
- return 0;
+ return tc574_config(link);
} /* tc574_attach */
/*
static const char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"};
-static void tc574_config(struct pcmcia_device *link)
+static int tc574_config(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
struct el3_private *lp = netdev_priv(dev);
8 << config.u.ram_size, ram_split[config.u.ram_split],
config.u.autoselect ? "autoselect " : "");
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
failed:
tc574_release(link);
- return;
+ return -ENODEV;
} /* tc574_config */
.drv = {
.name = "3c574_cs",
},
- .probe = tc574_attach,
+ .probe = tc574_probe,
.remove = tc574_detach,
.id_table = tc574_ids,
.suspend = tc574_suspend,
/*====================================================================*/
-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);
======================================================================*/
-static int tc589_attach(struct pcmcia_device *link)
+static int tc589_probe(struct pcmcia_device *link)
{
struct el3_private *lp;
struct net_device *dev;
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 */
/*======================================================================
#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);
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 */
/*======================================================================
.drv = {
.name = "3c589_cs",
},
- .probe = tc589_attach,
+ .probe = tc589_probe,
.remove = tc589_detach,
.id_table = tc589_ids,
.suspend = tc589_suspend,
/*====================================================================*/
-static void axnet_config(struct pcmcia_device *link);
+static int axnet_config(struct pcmcia_device *link);
static void axnet_release(struct pcmcia_device *link);
static int axnet_open(struct net_device *dev);
static int axnet_close(struct net_device *dev);
======================================================================*/
-static int axnet_attach(struct pcmcia_device *link)
+static int axnet_probe(struct pcmcia_device *link)
{
axnet_dev_t *info;
struct net_device *dev;
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- axnet_config(link);
-
- return 0;
+ return axnet_config(link);
} /* axnet_attach */
/*======================================================================
}
}
-static void axnet_config(struct pcmcia_device *link)
+static int axnet_config(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
axnet_dev_t *info = PRIV(dev);
} else {
printk(KERN_NOTICE " No MII transceivers found!\n");
}
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
failed:
axnet_release(link);
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return -ENODEV;
} /* axnet_config */
/*======================================================================
.drv = {
.name = "axnet_cs",
},
- .probe = axnet_attach,
+ .probe = axnet_probe,
.remove = axnet_detach,
.id_table = axnet_ids,
.suspend = axnet_suspend,
/*====================================================================*/
-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);
======================================================================*/
-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;
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);
#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;
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 */
/*======================================================================
.drv = {
.name = "com20020_cs",
},
- .probe = com20020_attach,
+ .probe = com20020_probe,
.remove = com20020_detach,
.id_table = com20020_ids,
.suspend = com20020_suspend,
/*
PCMCIA event handlers
*/
-static void fmvj18x_config(struct pcmcia_device *link);
+static int fmvj18x_config(struct pcmcia_device *link);
static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id);
static int fmvj18x_setup_mfc(struct pcmcia_device *link);
static void fmvj18x_release(struct pcmcia_device *link);
#define BANK_1U 0x24 /* bank 1 (CONFIG_1) */
#define BANK_2U 0x28 /* bank 2 (CONFIG_1) */
-static int fmvj18x_attach(struct pcmcia_device *link)
+static int fmvj18x_probe(struct pcmcia_device *link)
{
local_info_t *lp;
struct net_device *dev;
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- fmvj18x_config(link);
-
- return 0;
+ return fmvj18x_config(link);
} /* fmvj18x_attach */
/*====================================================================*/
return ret; /* RequestIO failed */
}
-static void fmvj18x_config(struct pcmcia_device *link)
+static int fmvj18x_config(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
local_info_t *lp = netdev_priv(dev);
for (i = 0; i < 6; i++)
printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n"));
- return;
+ return 0;
cs_failed:
/* All Card Services errors end up here */
failed:
fmvj18x_release(link);
link->state &= ~DEV_CONFIG_PENDING;
-
+ return -ENODEV;
} /* fmvj18x_config */
/*====================================================================*/
.drv = {
.name = "fmvj18x_cs",
},
- .probe = fmvj18x_attach,
+ .probe = fmvj18x_probe,
.remove = fmvj18x_detach,
.id_table = fmvj18x_ids,
.suspend = fmvj18x_suspend,
/*====================================================================*/
-static void ibmtr_config(struct pcmcia_device *link);
+static int ibmtr_config(struct pcmcia_device *link);
static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase);
static void ibmtr_release(struct pcmcia_device *link);
static void ibmtr_detach(struct pcmcia_device *p_dev);
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
link->state |= DEV_PRESENT;
- ibmtr_config(link);
-
- return 0;
+ return ibmtr_config(link);
} /* ibmtr_attach */
/*======================================================================
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-static void ibmtr_config(struct pcmcia_device *link)
+static int ibmtr_config(struct pcmcia_device *link)
{
ibmtr_dev_t *info = link->priv;
struct net_device *dev = info->dev;
for (i = 0; i < TR_ALEN; i++)
printk("%02X", dev->dev_addr[i]);
printk("\n");
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
failed:
ibmtr_release(link);
+ return -ENODEV;
} /* ibmtr_config */
/*======================================================================
Function Prototypes
---------------------------------------------------------------------------- */
-static void nmclan_config(struct pcmcia_device *link);
+static int nmclan_config(struct pcmcia_device *link);
static void nmclan_release(struct pcmcia_device *link);
static void nmclan_reset(struct net_device *dev);
Services.
---------------------------------------------------------------------------- */
-static int nmclan_attach(struct pcmcia_device *link)
+static int nmclan_probe(struct pcmcia_device *link)
{
mace_private *lp;
struct net_device *dev;
#endif
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- nmclan_config(link);
-
- return 0;
+ return nmclan_config(link);
} /* nmclan_attach */
/* ----------------------------------------------------------------------------
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-static void nmclan_config(struct pcmcia_device *link)
+static int nmclan_config(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
mace_private *lp = netdev_priv(dev);
printk(KERN_NOTICE "nmclan_cs: mace id not found: %x %x should"
" be 0x40 0x?9\n", sig[0], sig[1]);
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return -ENODEV;
}
}
dev->name, dev->base_addr, dev->irq, if_names[dev->if_port]);
for (i = 0; i < 6; i++)
printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n"));
- return;
+ return 0;
cs_failed:
- cs_error(link, last_fn, last_ret);
+ cs_error(link, last_fn, last_ret);
failed:
- nmclan_release(link);
- return;
-
+ nmclan_release(link);
+ return -ENODEV;
} /* nmclan_config */
/* ----------------------------------------------------------------------------
.drv = {
.name = "nmclan_cs",
},
- .probe = nmclan_attach,
+ .probe = nmclan_probe,
.remove = nmclan_detach,
.id_table = nmclan_ids,
.suspend = nmclan_suspend,
/*====================================================================*/
static void mii_phy_probe(struct net_device *dev);
-static void pcnet_config(struct pcmcia_device *link);
+static int pcnet_config(struct pcmcia_device *link);
static void pcnet_release(struct pcmcia_device *link);
static int pcnet_open(struct net_device *dev);
static int pcnet_close(struct net_device *dev);
dev->set_config = &set_config;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- pcnet_config(link);
-
- return 0;
+ return pcnet_config(link);
} /* pcnet_attach */
/*======================================================================
}
}
-static void pcnet_config(struct pcmcia_device *link)
+static int pcnet_config(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
pcnet_dev_t *info = PRIV(dev);
printk(" hw_addr ");
for (i = 0; i < 6; i++)
printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n"));
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
failed:
pcnet_release(link);
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return -ENODEV;
} /* pcnet_config */
/*======================================================================
/*====================================================================*/
static void smc91c92_detach(struct pcmcia_device *p_dev);
-static void smc91c92_config(struct pcmcia_device *link);
+static int smc91c92_config(struct pcmcia_device *link);
static void smc91c92_release(struct pcmcia_device *link);
static int smc_open(struct net_device *dev);
======================================================================*/
-static int smc91c92_attach(struct pcmcia_device *link)
+static int smc91c92_probe(struct pcmcia_device *link)
{
struct smc_private *smc;
struct net_device *dev;
smc->mii_if.reg_num_mask = 0x1f;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- smc91c92_config(link);
-
- return 0;
+ return smc91c92_config(link);
} /* smc91c92_attach */
/*======================================================================
#define CS_EXIT_TEST(ret, svc, label) \
if (ret != CS_SUCCESS) { cs_error(link, svc, ret); goto label; }
-static void smc91c92_config(struct pcmcia_device *link)
+static int smc91c92_config(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
struct smc_private *smc = netdev_priv(dev);
}
}
kfree(cfg_mem);
- return;
+ return 0;
config_undo:
unregister_netdev(dev);
smc91c92_release(link);
link->state &= ~DEV_CONFIG_PENDING;
kfree(cfg_mem);
-
+ return -ENODEV;
} /* smc91c92_config */
/*======================================================================
.drv = {
.name = "smc91c92_cs",
},
- .probe = smc91c92_attach,
+ .probe = smc91c92_probe,
.remove = smc91c92_detach,
.id_table = smc91c92_ids,
.suspend = smc91c92_suspend,
*/
static int has_ce2_string(struct pcmcia_device * link);
-static void xirc2ps_config(struct pcmcia_device * link);
+static int xirc2ps_config(struct pcmcia_device * link);
static void xirc2ps_release(struct pcmcia_device * link);
/****************
*/
static int
-xirc2ps_attach(struct pcmcia_device *link)
+xirc2ps_probe(struct pcmcia_device *link)
{
struct net_device *dev;
local_info_t *local;
#endif
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- xirc2ps_config(link);
-
- return 0;
+ return xirc2ps_config(link);
} /* xirc2ps_attach */
/****************
* is received, to configure the PCMCIA socket, and to make the
* ethernet device available to the system.
*/
-static void
+static int
xirc2ps_config(struct pcmcia_device * link)
{
struct net_device *dev = link->priv;
printk("%c%02X", i?':':' ', dev->dev_addr[i]);
printk("\n");
- return;
+ return 0;
config_error:
link->state &= ~DEV_CONFIG_PENDING;
xirc2ps_release(link);
- return;
+ return -ENODEV;
cis_error:
printk(KNOT_XIRC "unable to parse CIS\n");
failure:
link->state &= ~DEV_CONFIG_PENDING;
+ return -ENODEV;
} /* xirc2ps_config */
/****************
.drv = {
.name = "xirc2ps_cs",
},
- .probe = xirc2ps_attach,
+ .probe = xirc2ps_probe,
.remove = xirc2ps_detach,
.id_table = xirc2ps_ids,
.suspend = xirc2ps_suspend,
event handler.
*/
-static void airo_config(struct pcmcia_device *link);
+static int airo_config(struct pcmcia_device *link);
static void airo_release(struct pcmcia_device *link);
/*
======================================================================*/
-static int airo_attach(struct pcmcia_device *p_dev)
+static int airo_probe(struct pcmcia_device *p_dev)
{
local_info_t *local;
p_dev->priv = local;
p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- airo_config(p_dev);
-
- return 0;
+ return airo_config(p_dev);
} /* airo_attach */
/*======================================================================
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-static void airo_config(struct pcmcia_device *link)
+static int airo_config(struct pcmcia_device *link)
{
tuple_t tuple;
cisparse_t parse;
printk("\n");
link->state &= ~DEV_CONFIG_PENDING;
- return;
-
+ return 0;
+
cs_failed:
cs_error(link, last_fn, last_ret);
airo_release(link);
-
+ return -ENODEV;
} /* airo_config */
/*======================================================================
.drv = {
.name = "airo_cs",
},
- .probe = airo_attach,
+ .probe = airo_probe,
.remove = airo_detach,
.id_table = airo_ids,
.suspend = airo_suspend,
event handler.
*/
-static void atmel_config(struct pcmcia_device *link);
+static int atmel_config(struct pcmcia_device *link);
static void atmel_release(struct pcmcia_device *link);
/*
======================================================================*/
-static int atmel_attach(struct pcmcia_device *p_dev)
+static int atmel_probe(struct pcmcia_device *p_dev)
{
local_info_t *local;
p_dev->priv = local;
p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- atmel_config(p_dev);
-
- return 0;
+ return atmel_config(p_dev);
} /* atmel_attach */
/*======================================================================
return 0;
}
-static void atmel_config(struct pcmcia_device *link)
+static int atmel_config(struct pcmcia_device *link)
{
tuple_t tuple;
cisparse_t parse;
link->dev_node = &dev->node;
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
atmel_release(link);
+ return -ENODEV;
}
/*======================================================================
.drv = {
.name = "atmel_cs",
},
- .probe = atmel_attach,
+ .probe = atmel_probe,
.remove = atmel_detach,
.id_table = atmel_ids,
.suspend = atmel_suspend,
/* allocate local data and register with CardServices
* initialize dev_link structure, but do not configure the card yet */
-static int prism2_attach(struct pcmcia_device *p_dev)
+static int hostap_cs_probe(struct pcmcia_device *p_dev)
{
+ int ret;
+
PDEBUG(DEBUG_HW, "%s: setting Vcc=33 (constant)\n", dev_info);
p_dev->conf.IntType = INT_MEMORY_AND_IO;
p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- if (prism2_config(p_dev))
+ ret = prism2_config(p_dev);
+ if (ret) {
PDEBUG(DEBUG_EXTRA, "prism2_config() failed\n");
+ }
- return 0;
+ return ret;
}
.drv = {
.name = "hostap_cs",
},
- .probe = prism2_attach,
+ .probe = hostap_cs_probe,
.remove = prism2_detach,
.owner = THIS_MODULE,
.id_table = hostap_cs_ids,
/* PCMCIA (Card Services) related functions */
static void netwave_release(struct pcmcia_device *link); /* Card removal */
-static void netwave_pcmcia_config(struct pcmcia_device *arg); /* Runs after card
+static int netwave_pcmcia_config(struct pcmcia_device *arg); /* Runs after card
insertion */
static void netwave_detach(struct pcmcia_device *p_dev); /* Destroy instance */
* configure the card at this point -- we wait until we receive a
* card insertion event.
*/
-static int netwave_attach(struct pcmcia_device *link)
+static int netwave_probe(struct pcmcia_device *link)
{
struct net_device *dev;
netwave_private *priv;
link->irq.Instance = dev;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- netwave_pcmcia_config( link);
-
- return 0;
+ return netwave_pcmcia_config( link);
} /* netwave_attach */
/*
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-static void netwave_pcmcia_config(struct pcmcia_device *link) {
+static int netwave_pcmcia_config(struct pcmcia_device *link) {
struct net_device *dev = link->priv;
netwave_private *priv = netdev_priv(dev);
tuple_t tuple;
printk(KERN_DEBUG "Netwave_reset: revision %04x %04x\n",
get_uint16(ramBase + NETWAVE_EREG_ARW),
get_uint16(ramBase + NETWAVE_EREG_ARW+2));
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
failed:
netwave_release(link);
+ return -ENODEV;
} /* netwave_pcmcia_config */
/*
.drv = {
.name = "netwave_cs",
},
- .probe = netwave_attach,
+ .probe = netwave_probe,
.remove = netwave_detach,
.id_table = netwave_ids,
.suspend = netwave_suspend,
/* Function prototypes */
/********************************************************************/
-static void orinoco_cs_config(struct pcmcia_device *link);
+static int orinoco_cs_config(struct pcmcia_device *link);
static void orinoco_cs_release(struct pcmcia_device *link);
static void orinoco_cs_detach(struct pcmcia_device *p_dev);
* configure the card at this point -- we wait until we receive a card
* insertion event. */
static int
-orinoco_cs_attach(struct pcmcia_device *link)
+orinoco_cs_probe(struct pcmcia_device *link)
{
struct net_device *dev;
struct orinoco_private *priv;
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- orinoco_cs_config(link);
-
- return 0;
+ return orinoco_cs_config(link);
} /* orinoco_cs_attach */
/*
last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \
} while (0)
-static void
+static int
orinoco_cs_config(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
link->io.BasePort2 + link->io.NumPorts2 - 1);
printk("\n");
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
failed:
orinoco_cs_release(link);
+ return -ENODEV;
} /* orinoco_cs_config */
/*
.drv = {
.name = DRIVER_NAME,
},
- .probe = orinoco_cs_attach,
+ .probe = orinoco_cs_probe,
.remove = orinoco_cs_detach,
.id_table = orinoco_cs_ids,
.suspend = orinoco_cs_suspend,
#define DEBUG(n, args...)
#endif
/** Prototypes based on PCMCIA skeleton driver *******************************/
-static void ray_config(struct pcmcia_device *link);
+static int ray_config(struct pcmcia_device *link);
static void ray_release(struct pcmcia_device *link);
static void ray_detach(struct pcmcia_device *p_dev);
configure the card at this point -- we wait until we receive a
card insertion event.
=============================================================================*/
-static int ray_attach(struct pcmcia_device *p_dev)
+static int ray_probe(struct pcmcia_device *p_dev)
{
ray_dev_t *local;
struct net_device *dev;
p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
this_device = p_dev;
- ray_config(p_dev);
-
- return 0;
+ return ray_config(p_dev);
fail_alloc_dev:
return -ENOMEM;
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
#define MAX_TUPLE_SIZE 128
-static void ray_config(struct pcmcia_device *link)
+static int ray_config(struct pcmcia_device *link)
{
tuple_t tuple;
cisparse_t parse;
DEBUG(3,"ray_config amem=%p\n",local->amem);
if (ray_init(dev) < 0) {
ray_release(link);
- return;
+ return -ENODEV;
}
SET_NETDEV_DEV(dev, &handle_to_dev(link));
if (i != 0) {
printk("ray_config register_netdev() failed\n");
ray_release(link);
- return;
+ return i;
}
strcpy(local->node.dev_name, dev->name);
for (i = 0; i < 6; i++)
printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n"));
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
ray_release(link);
+ return -ENODEV;
} /* ray_config */
static inline struct ccs __iomem *ccs_base(ray_dev_t *dev)
.drv = {
.name = "ray_cs",
},
- .probe = ray_attach,
+ .probe = ray_probe,
.remove = ray_detach,
.id_table = ray_ids,
.suspend = ray_suspend,
/* Function prototypes */
/********************************************************************/
-static void spectrum_cs_config(struct pcmcia_device *link);
+static int spectrum_cs_config(struct pcmcia_device *link);
static void spectrum_cs_release(struct pcmcia_device *link);
/********************************************************************/
* configure the card at this point -- we wait until we receive a card
* insertion event. */
static int
-spectrum_cs_attach(struct pcmcia_device *link)
+spectrum_cs_probe(struct pcmcia_device *link)
{
struct net_device *dev;
struct orinoco_private *priv;
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- spectrum_cs_config(link);
-
- return 0;
+ return spectrum_cs_config(link);
} /* spectrum_cs_attach */
/*
* device available to the system.
*/
-static void
+static int
spectrum_cs_config(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
link->io.BasePort2 + link->io.NumPorts2 - 1);
printk("\n");
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
failed:
spectrum_cs_release(link);
+ return -ENODEV;
} /* spectrum_cs_config */
/*
.drv = {
.name = DRIVER_NAME,
},
- .probe = spectrum_cs_attach,
+ .probe = spectrum_cs_probe,
.remove = spectrum_cs_detach,
.suspend = spectrum_cs_suspend,
.resume = spectrum_cs_resume,
* card insertion event.
*/
static int
-wavelan_attach(struct pcmcia_device *p_dev)
+wavelan_probe(struct pcmcia_device *p_dev)
{
struct net_device * dev; /* Interface generic data */
net_local * lp; /* Interface specific data */
+ int ret;
#ifdef DEBUG_CALLBACK_TRACE
printk(KERN_DEBUG "-> wavelan_attach()\n");
dev->mtu = WAVELAN_MTU;
p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- if(wv_pcmcia_config(p_dev) &&
- wv_hw_config(dev))
- wv_init_info(dev);
- else
+ ret = wv_pcmcia_config(p_dev);
+ if (ret)
+ return ret;
+
+ ret = wv_hw_config(dev);
+ if (ret) {
dev->irq = 0;
+ pcmcia_disable_device(p_dev);
+ return ret;
+ }
+
+ wv_init_info(dev);
#ifdef DEBUG_CALLBACK_TRACE
printk(KERN_DEBUG "<- wavelan_attach()\n");
.drv = {
.name = "wavelan_cs",
},
- .probe = wavelan_attach,
+ .probe = wavelan_probe,
.remove = wavelan_detach,
.id_table = wavelan_ids,
.suspend = wavelan_suspend,
* release a socket, in response to card insertion and ejection events. They
* are invoked from the wl24 event handler.
*/
-static void wl3501_config(struct pcmcia_device *link);
+static int wl3501_config(struct pcmcia_device *link);
static void wl3501_release(struct pcmcia_device *link);
/*
* The dev_link structure is initialized, but we don't actually configure the
* card at this point -- we wait until we receive a card insertion event.
*/
-static int wl3501_attach(struct pcmcia_device *p_dev)
+static int wl3501_probe(struct pcmcia_device *p_dev)
{
struct net_device *dev;
struct wl3501_card *this;
p_dev->priv = p_dev->irq.Instance = dev;
p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- wl3501_config(p_dev);
-
- return 0;
+ return wl3501_config(p_dev);
out_link:
return -ENOMEM;
}
* received, to configure the PCMCIA socket, and to make the ethernet device
* available to the system.
*/
-static void wl3501_config(struct pcmcia_device *link)
+static int wl3501_config(struct pcmcia_device *link)
{
tuple_t tuple;
cisparse_t parse;
spin_lock_init(&this->lock);
init_waitqueue_head(&this->wait);
netif_start_queue(dev);
- goto out;
+ return 0;
+
cs_failed:
cs_error(link, last_fn, last_ret);
failed:
wl3501_release(link);
-out:
- return;
+ return -ENODEV;
}
/**
.drv = {
.name = "wl3501_cs",
},
- .probe = wl3501_attach,
+ .probe = wl3501_probe,
.remove = wl3501_detach,
.id_table = wl3501_ids,
.suspend = wl3501_suspend,
} parport_info_t;
static void parport_detach(struct pcmcia_device *p_dev);
-static void parport_config(struct pcmcia_device *link);
+static int parport_config(struct pcmcia_device *link);
static void parport_cs_release(struct pcmcia_device *);
/*======================================================================
======================================================================*/
-static int parport_attach(struct pcmcia_device *link)
+static int parport_probe(struct pcmcia_device *link)
{
parport_info_t *info;
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- parport_config(link);
-
- return 0;
+ return parport_config(link);
} /* parport_attach */
/*======================================================================
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-void parport_config(struct pcmcia_device *link)
+static int parport_config(struct pcmcia_device *link)
{
parport_info_t *info = link->priv;
tuple_t tuple;
link->dev_node = &info->node;
link->state &= ~DEV_CONFIG_PENDING;
- return;
-
+ return 0;
+
cs_failed:
cs_error(link, last_fn, last_ret);
failed:
parport_cs_release(link);
link->state &= ~DEV_CONFIG_PENDING;
-
+ return -ENODEV;
} /* parport_config */
/*======================================================================
.drv = {
.name = "parport_cs",
},
- .probe = parport_attach,
+ .probe = parport_probe,
.remove = parport_detach,
.id_table = parport_ids,
};
static void aha152x_release_cs(struct pcmcia_device *link);
static void aha152x_detach(struct pcmcia_device *p_dev);
-static void aha152x_config_cs(struct pcmcia_device *link);
+static int aha152x_config_cs(struct pcmcia_device *link);
static struct pcmcia_device *dev_list;
-static int aha152x_attach(struct pcmcia_device *link)
+static int aha152x_probe(struct pcmcia_device *link)
{
scsi_info_t *info;
link->conf.Present = PRESENT_OPTION;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- aha152x_config_cs(link);
-
- return 0;
+ return aha152x_config_cs(link);
} /* aha152x_attach */
/*====================================================================*/
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-static void aha152x_config_cs(struct pcmcia_device *link)
+static int aha152x_config_cs(struct pcmcia_device *link)
{
scsi_info_t *info = link->priv;
struct aha152x_setup s;
info->host = host;
link->state &= ~DEV_CONFIG_PENDING;
- return;
-
+ return 0;
+
cs_failed:
cs_error(link, last_fn, last_ret);
aha152x_release_cs(link);
- return;
+ return -ENODEV;
}
static void aha152x_release_cs(struct pcmcia_device *link)
.drv = {
.name = "aha152x_cs",
},
- .probe = aha152x_attach,
+ .probe = aha152x_probe,
.remove = aha152x_detach,
.id_table = aha152x_ids,
.resume = aha152x_resume,
module_init(init_aha152x_cs);
module_exit(exit_aha152x_cs);
-
static void fdomain_release(struct pcmcia_device *link);
static void fdomain_detach(struct pcmcia_device *p_dev);
-static void fdomain_config(struct pcmcia_device *link);
+static int fdomain_config(struct pcmcia_device *link);
-static int fdomain_attach(struct pcmcia_device *link)
+static int fdomain_probe(struct pcmcia_device *link)
{
- scsi_info_t *info;
-
- DEBUG(0, "fdomain_attach()\n");
-
- /* Create new SCSI device */
- info = kmalloc(sizeof(*info), GFP_KERNEL);
- if (!info) return -ENOMEM;
- memset(info, 0, sizeof(*info));
- info->p_dev = link;
- link->priv = info;
- link->io.NumPorts1 = 0x10;
- link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
- link->io.IOAddrLines = 10;
- link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
- link->irq.IRQInfo1 = IRQ_LEVEL_ID;
- link->conf.Attributes = CONF_ENABLE_IRQ;
- link->conf.IntType = INT_MEMORY_AND_IO;
- link->conf.Present = PRESENT_OPTION;
-
- link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- fdomain_config(link);
-
- return 0;
+ scsi_info_t *info;
+
+ DEBUG(0, "fdomain_attach()\n");
+
+ /* Create new SCSI device */
+ info = kzalloc(sizeof(*info), GFP_KERNEL);
+ if (!info)
+ return -ENOMEM;
+
+ info->p_dev = link;
+ link->priv = info;
+ link->io.NumPorts1 = 0x10;
+ link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
+ link->io.IOAddrLines = 10;
+ link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
+ link->irq.IRQInfo1 = IRQ_LEVEL_ID;
+ link->conf.Attributes = CONF_ENABLE_IRQ;
+ link->conf.IntType = INT_MEMORY_AND_IO;
+ link->conf.Present = PRESENT_OPTION;
+
+ link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
+ return fdomain_config(link);
} /* fdomain_attach */
/*====================================================================*/
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-static void fdomain_config(struct pcmcia_device *link)
+static int fdomain_config(struct pcmcia_device *link)
{
scsi_info_t *info = link->priv;
tuple_t tuple;
/* Configure card */
link->state |= DEV_CONFIG;
-
+
tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
while (1) {
CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
-
+
/* A bad hack... */
release_region(link->io.BasePort1, link->io.NumPorts1);
/* Set configuration options for the fdomain driver */
sprintf(str, "%d,%d", link->io.BasePort1, link->irq.AssignedIRQ);
fdomain_setup(str);
-
+
host = __fdomain_16x0_detect(&fdomain_driver_template);
if (!host) {
printk(KERN_INFO "fdomain_cs: no SCSI devices found\n");
goto cs_failed;
}
-
- scsi_add_host(host, NULL); /* XXX handle failure */
+
+ if (scsi_add_host(host, NULL))
+ goto cs_failed;
scsi_scan_host(host);
sprintf(info->node.dev_name, "scsi%d", host->host_no);
link->dev_node = &info->node;
info->host = host;
-
+
link->state &= ~DEV_CONFIG_PENDING;
- return;
-
+ return 0;
+
cs_failed:
cs_error(link, last_fn, last_ret);
fdomain_release(link);
- return;
-
+ return -ENODEV;
} /* fdomain_config */
/*====================================================================*/
.drv = {
.name = "fdomain_cs",
},
- .probe = fdomain_attach,
+ .probe = fdomain_probe,
.remove = fdomain_detach,
.id_table = fdomain_ids,
.resume = fdomain_resume,
configure the card at this point -- we wait until we receive a
card insertion event.
======================================================================*/
-static int nsp_cs_attach(struct pcmcia_device *link)
+static int nsp_cs_probe(struct pcmcia_device *link)
{
scsi_info_t *info;
nsp_hw_data *data = &nsp_data_base;
+ int ret;
nsp_dbg(NSP_DEBUG_INIT, "in");
link->conf.Present = PRESENT_OPTION;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- nsp_cs_config(link);
+ ret = nsp_cs_config(link);
nsp_dbg(NSP_DEBUG_INIT, "link=0x%p", link);
- return 0;
+ return ret;
} /* nsp_cs_attach */
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
/*====================================================================*/
-static void nsp_cs_config(struct pcmcia_device *link)
+static int nsp_cs_config(struct pcmcia_device *link)
{
+ int ret;
scsi_info_t *info = link->priv;
tuple_t tuple;
cisparse_t parse;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,74))
- scsi_add_host (host, NULL);
+ ret = scsi_add_host (host, NULL);
+ if (ret)
+ goto cs_failed;
+
scsi_scan_host(host);
snprintf(info->node.dev_name, sizeof(info->node.dev_name), "scsi%d", host->host_no);
printk("\n");
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return 0;
cs_failed:
nsp_dbg(NSP_DEBUG_INIT, "config fail");
cs_error(link, last_fn, last_ret);
nsp_cs_release(link);
- return;
+ return -ENODEV;
} /* nsp_cs_config */
#undef CS_CHECK
.drv = {
.name = "nsp_cs",
},
- .probe = nsp_cs_attach,
+ .probe = nsp_cs_probe,
.remove = nsp_cs_detach,
.id_table = nsp_cs_ids,
.suspend = nsp_cs_suspend,
/* Card service functions */
static void nsp_cs_detach (struct pcmcia_device *p_dev);
static void nsp_cs_release(struct pcmcia_device *link);
-static void nsp_cs_config (struct pcmcia_device *link);
+static int nsp_cs_config (struct pcmcia_device *link);
/* Linux SCSI subsystem specific functions */
static struct Scsi_Host *nsp_detect (struct scsi_host_template *sht);
static void qlogic_release(struct pcmcia_device *link);
static void qlogic_detach(struct pcmcia_device *p_dev);
-static void qlogic_config(struct pcmcia_device * link);
+static int qlogic_config(struct pcmcia_device * link);
static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host,
struct pcmcia_device *link, int qbase, int qlirq)
err:
return NULL;
}
-static int qlogic_attach(struct pcmcia_device *link)
+static int qlogic_probe(struct pcmcia_device *link)
{
scsi_info_t *info;
link->conf.Present = PRESENT_OPTION;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- qlogic_config(link);
-
- return 0;
+ return qlogic_config(link);
} /* qlogic_attach */
/*====================================================================*/
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-static void qlogic_config(struct pcmcia_device * link)
+static int qlogic_config(struct pcmcia_device * link)
{
scsi_info_t *info = link->priv;
tuple_t tuple;
if (!host) {
printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name);
- goto out;
+ goto cs_failed;
}
sprintf(info->node.dev_name, "scsi%d", host->host_no);
link->dev_node = &info->node;
info->host = host;
-out:
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
pcmcia_disable_device(link);
- return;
+ return -ENODEV;
} /* qlogic_config */
.drv = {
.name = "qlogic_cs",
},
- .probe = qlogic_attach,
+ .probe = qlogic_probe,
.remove = qlogic_detach,
.id_table = qlogic_ids,
.resume = qlogic_resume,
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-static void
+static int
SYM53C500_config(struct pcmcia_device *link)
{
struct scsi_info_t *info = link->priv;
scsi_scan_host(host);
- goto out; /* SUCCESS */
+ link->state &= ~DEV_CONFIG_PENDING;
+ return 0;
err_free_irq:
free_irq(irq_level, host);
err_release:
release_region(port_base, 0x10);
printk(KERN_INFO "sym53c500_cs: no SCSI devices found\n");
-
-out:
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return -ENODEV;
cs_failed:
cs_error(link, last_fn, last_ret);
SYM53C500_release(link);
- return;
+ return -ENODEV;
} /* SYM53C500_config */
static int sym53c500_resume(struct pcmcia_device *link)
} /* SYM53C500_detach */
static int
-SYM53C500_attach(struct pcmcia_device *link)
+SYM53C500_probe(struct pcmcia_device *link)
{
struct scsi_info_t *info;
link->conf.Present = PRESENT_OPTION;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- SYM53C500_config(link);
-
- return 0;
+ return SYM53C500_config(link);
} /* SYM53C500_attach */
MODULE_AUTHOR("Bob Tracy <rct@frus.com>");
.drv = {
.name = "sym53c500_cs",
},
- .probe = SYM53C500_attach,
+ .probe = SYM53C500_probe,
.remove = SYM53C500_detach,
.id_table = sym53c500_ids,
.resume = sym53c500_resume,
};
-static void serial_config(struct pcmcia_device * link);
+static int serial_config(struct pcmcia_device * link);
/*======================================================================
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- serial_config(link);
-
- return 0;
+ return serial_config(link);
}
/*======================================================================
======================================================================*/
-void serial_config(struct pcmcia_device * link)
+static int serial_config(struct pcmcia_device * link)
{
struct serial_info *info = link->priv;
struct serial_cfg_mem *cfg_mem;
link->dev_node = &info->node[0];
link->state &= ~DEV_CONFIG_PENDING;
kfree(cfg_mem);
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
serial_remove(link);
link->state &= ~DEV_CONFIG_PENDING;
kfree(cfg_mem);
+ return -ENODEV;
}
static struct pcmcia_device_id serial_ids[] = {
} ixj_info_t;
static void ixj_detach(struct pcmcia_device *p_dev);
-static void ixj_config(struct pcmcia_device * link);
+static int ixj_config(struct pcmcia_device * link);
static void ixj_cs_release(struct pcmcia_device * link);
-static int ixj_attach(struct pcmcia_device *p_dev)
+static int ixj_probe(struct pcmcia_device *p_dev)
{
DEBUG(0, "ixj_attach()\n");
/* Create new ixj device */
memset(p_dev->priv, 0, sizeof(struct ixj_info_t));
p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- ixj_config(p_dev);
-
- return 0;
+ return ixj_config(p_dev);
}
static void ixj_detach(struct pcmcia_device *link)
return;
}
-static void ixj_config(struct pcmcia_device * link)
+static int ixj_config(struct pcmcia_device * link)
{
IXJ *j;
ixj_info_t *info;
link->dev_node = &info->node;
ixj_get_serial(link, j);
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
ixj_cs_release(link);
+ return -ENODEV;
}
static void ixj_cs_release(struct pcmcia_device *link)
.drv = {
.name = "ixj_cs",
},
- .probe = ixj_attach,
+ .probe = ixj_probe,
.remove = ixj_detach,
.id_table = ixj_ids,
};
platform_device_unregister(&platform_dev);
}
-static void sl811_cs_config(struct pcmcia_device *link)
+static int sl811_cs_config(struct pcmcia_device *link)
{
struct device *parent = &handle_to_dev(link);
local_info_t *dev = link->priv;
cs_error(link, last_fn, last_ret);
sl811_cs_release(link);
link->state &= ~DEV_CONFIG_PENDING;
+ return -ENODEV;
}
+ return 0;
}
-static int sl811_cs_attach(struct pcmcia_device *link)
+static int sl811_cs_probe(struct pcmcia_device *link)
{
local_info_t *local;
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- sl811_cs_config(link);
-
- return 0;
+ return sl811_cs_config(link);
}
static struct pcmcia_device_id sl811_ids[] = {
.drv = {
.name = (char *)driver_name,
},
- .probe = sl811_cs_attach,
+ .probe = sl811_cs_probe,
.remove = sl811_cs_detach,
.id_table = sl811_ids,
};
/*
* prototypes
*/
-static void pdacf_config(struct pcmcia_device *link);
+static int pdacf_config(struct pcmcia_device *link);
static void snd_pdacf_detach(struct pcmcia_device *p_dev);
static void pdacf_release(struct pcmcia_device *link)
/*
* snd_pdacf_attach - attach callback for cs
*/
-static int snd_pdacf_attach(struct pcmcia_device *link)
+static int snd_pdacf_probe(struct pcmcia_device *link)
{
int i;
struct snd_pdacf *pdacf;
link->conf.ConfigIndex = 1;
link->conf.Present = PRESENT_OPTION;
- pdacf_config(link);
-
- return 0;
+ return pdacf_config(link);
}
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-static void pdacf_config(struct pcmcia_device *link)
+static int pdacf_config(struct pcmcia_device *link)
{
struct snd_pdacf *pdacf = link->priv;
tuple_t tuple;
parse = kmalloc(sizeof(*parse), GFP_KERNEL);
if (! parse) {
snd_printk(KERN_ERR "pdacf_config: cannot allocate\n");
- return;
+ return -ENOMEM;
}
tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
tuple.Attributes = 0;
link->dev_node = &pdacf->node;
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
failed:
pcmcia_disable_device(link);
+ return -ENODEV;
}
#ifdef CONFIG_PM
.drv = {
.name = "snd-pdaudiocf",
},
- .probe = snd_pdacf_attach,
+ .probe = snd_pdacf_probe,
.remove = snd_pdacf_detach,
.id_table = snd_pdacf_ids,
#ifdef CONFIG_PM
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-static void vxpocket_config(struct pcmcia_device *link)
+static int vxpocket_config(struct pcmcia_device *link)
{
struct vx_core *chip = link->priv;
struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip;
parse = kmalloc(sizeof(*parse), GFP_KERNEL);
if (! parse) {
snd_printk(KERN_ERR "vx: cannot allocate\n");
- return;
+ return -ENOMEM;
}
tuple.Attributes = 0;
tuple.TupleData = (cisdata_t *)buf;
link->dev_node = &vxp->node;
link->state &= ~DEV_CONFIG_PENDING;
kfree(parse);
- return;
+ return 9;
cs_failed:
cs_error(link, last_fn, last_ret);
failed:
pcmcia_disable_device(link);
kfree(parse);
+ return -ENODEV;
}
#ifdef CONFIG_PM
/*
*/
-static int vxpocket_attach(struct pcmcia_device *p_dev)
+static int vxpocket_probe(struct pcmcia_device *p_dev)
{
struct snd_card *card;
struct snd_vxpocket *vxp;
vxp->p_dev = p_dev;
vxp->p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- vxpocket_config(p_dev);
-
- return 0;
+ return vxpocket_config(p_dev);
}
static void vxpocket_detach(struct pcmcia_device *link)
.drv = {
.name = "snd-vxpocket",
},
- .probe = vxpocket_attach,
+ .probe = vxpocket_probe,
.remove = vxpocket_detach,
.id_table = vxp_ids,
#ifdef CONFIG_PM