Browse Source

[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>
imx_3.10.17_1.0.0_ga
Dominik Brodowski 15 years ago
parent
commit
15b99ac172
45 changed files with 379 additions and 404 deletions
  1. +7
    -8
      drivers/bluetooth/bluecard_cs.c
  2. +7
    -8
      drivers/bluetooth/bt3c_cs.c
  3. +7
    -8
      drivers/bluetooth/btuart_cs.c
  4. +7
    -8
      drivers/bluetooth/dtl1_cs.c
  5. +9
    -6
      drivers/char/pcmcia/cm4000_cs.c
  6. +9
    -6
      drivers/char/pcmcia/cm4040_cs.c
  7. +10
    -6
      drivers/char/pcmcia/synclink_cs.c
  8. +7
    -8
      drivers/ide/legacy/ide-cs.c
  9. +10
    -11
      drivers/isdn/hardware/avm/avm_cs.c
  10. +9
    -10
      drivers/isdn/hisax/avma1_cs.c
  11. +7
    -8
      drivers/isdn/hisax/elsa_cs.c
  12. +8
    -8
      drivers/isdn/hisax/sedlbauer_cs.c
  13. +11
    -10
      drivers/isdn/hisax/teles_cs.c
  14. +11
    -12
      drivers/mtd/maps/pcmciamtd.c
  15. +7
    -9
      drivers/net/pcmcia/3c574_cs.c
  16. +7
    -10
      drivers/net/pcmcia/3c589_cs.c
  17. +7
    -9
      drivers/net/pcmcia/axnet_cs.c
  18. +7
    -8
      drivers/net/pcmcia/com20020_cs.c
  19. +7
    -9
      drivers/net/pcmcia/fmvj18x_cs.c
  20. +5
    -6
      drivers/net/pcmcia/ibmtr_cs.c
  21. +10
    -13
      drivers/net/pcmcia/nmclan_cs.c
  22. +5
    -7
      drivers/net/pcmcia/pcnet_cs.c
  23. +7
    -9
      drivers/net/pcmcia/smc91c92_cs.c
  24. +8
    -9
      drivers/net/pcmcia/xirc2ps_cs.c
  25. +8
    -10
      drivers/net/wireless/airo_cs.c
  26. +7
    -8
      drivers/net/wireless/atmel_cs.c
  27. +8
    -4
      drivers/net/wireless/hostap/hostap_cs.c
  28. +7
    -8
      drivers/net/wireless/netwave_cs.c
  29. +7
    -8
      drivers/net/wireless/orinoco_cs.c
  30. +9
    -10
      drivers/net/wireless/ray_cs.c
  31. +7
    -8
      drivers/net/wireless/spectrum_cs.c
  32. +14
    -6
      drivers/net/wireless/wavelan_cs.c
  33. +8
    -10
      drivers/net/wireless/wl3501_cs.c
  34. +8
    -10
      drivers/parport/parport_cs.c
  35. +8
    -11
      drivers/scsi/pcmcia/aha152x_stub.c
  36. +36
    -37
      drivers/scsi/pcmcia/fdomain_stub.c
  37. +13
    -8
      drivers/scsi/pcmcia/nsp_cs.c
  38. +1
    -1
      drivers/scsi/pcmcia/nsp_cs.h
  39. +8
    -11
      drivers/scsi/pcmcia/qlogic_stub.c
  40. +8
    -11
      drivers/scsi/pcmcia/sym53c500_cs.c
  41. +5
    -6
      drivers/serial/serial_cs.c
  42. +7
    -8
      drivers/telephony/ixj_pcmcia.c
  43. +6
    -6
      drivers/usb/host/sl811_cs.c
  44. +8
    -9
      sound/pcmcia/pdaudiocf/pdaudiocf.c
  45. +7
    -8
      sound/pcmcia/vx/vxpocket.c

+ 7
- 8
drivers/bluetooth/bluecard_cs.c View File

@ -85,7 +85,7 @@ typedef struct bluecard_info_t {
} 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);
@ -856,7 +856,7 @@ static int bluecard_close(bluecard_info_t *info)
return 0;
}
static int bluecard_attach(struct pcmcia_device *link)
static int bluecard_probe(struct pcmcia_device *link)
{
bluecard_info_t *info;
@ -880,9 +880,7 @@ static int bluecard_attach(struct pcmcia_device *link)
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
bluecard_config(link);
return 0;
return bluecard_config(link);
}
@ -912,7 +910,7 @@ static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t
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;
@ -973,13 +971,14 @@ static void bluecard_config(struct pcmcia_device *link)
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;
}
@ -1008,7 +1007,7 @@ static struct pcmcia_driver bluecard_driver = {
.drv = {
.name = "bluecard_cs",
},
.probe = bluecard_attach,
.probe = bluecard_probe,
.remove = bluecard_detach,
.id_table = bluecard_ids,
};


+ 7
- 8
drivers/bluetooth/bt3c_cs.c View File

@ -88,7 +88,7 @@ typedef struct bt3c_info_t {
} 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);
@ -645,7 +645,7 @@ static int bt3c_close(bt3c_info_t *info)
return 0;
}
static int bt3c_attach(struct pcmcia_device *link)
static int bt3c_probe(struct pcmcia_device *link)
{
bt3c_info_t *info;
@ -669,9 +669,7 @@ static int bt3c_attach(struct pcmcia_device *link)
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
bt3c_config(link);
return 0;
return bt3c_config(link);
}
@ -710,7 +708,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *
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;
@ -809,13 +807,14 @@ found_port:
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;
}
@ -841,7 +840,7 @@ static struct pcmcia_driver bt3c_driver = {
.drv = {
.name = "bt3c_cs",
},
.probe = bt3c_attach,
.probe = bt3c_probe,
.remove = bt3c_detach,
.id_table = bt3c_ids,
};


+ 7
- 8
drivers/bluetooth/btuart_cs.c View File

@ -84,7 +84,7 @@ typedef struct btuart_info_t {
} 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);
@ -576,7 +576,7 @@ static int btuart_close(btuart_info_t *info)
return 0;
}
static int btuart_attach(struct pcmcia_device *link)
static int btuart_probe(struct pcmcia_device *link)
{
btuart_info_t *info;
@ -600,9 +600,7 @@ static int btuart_attach(struct pcmcia_device *link)
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
btuart_config(link);
return 0;
return btuart_config(link);
}
@ -641,7 +639,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *
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;
@ -741,13 +739,14 @@ found_port:
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;
}
@ -772,7 +771,7 @@ static struct pcmcia_driver btuart_driver = {
.drv = {
.name = "btuart_cs",
},
.probe = btuart_attach,
.probe = btuart_probe,
.remove = btuart_detach,
.id_table = btuart_ids,
};


+ 7
- 8
drivers/bluetooth/dtl1_cs.c View File

@ -87,7 +87,7 @@ typedef struct dtl1_info_t {
} 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);
@ -555,7 +555,7 @@ static int dtl1_close(dtl1_info_t *info)
return 0;
}
static int dtl1_attach(struct pcmcia_device *link)
static int dtl1_probe(struct pcmcia_device *link)
{
dtl1_info_t *info;
@ -579,9 +579,7 @@ static int dtl1_attach(struct pcmcia_device *link)
link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
dtl1_config(link);
return 0;
return dtl1_config(link);
}
@ -620,7 +618,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *
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;
@ -693,13 +691,14 @@ static void dtl1_config(struct pcmcia_device *link)
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;
}
@ -727,7 +726,7 @@ static struct pcmcia_driver dtl1_driver = {
.drv = {
.name = "dtl1_cs",
},
.probe = dtl1_attach,
.probe = dtl1_probe,
.remove = dtl1_detach,
.id_table = dtl1_ids,
};


+ 9
- 6
drivers/char/pcmcia/cm4000_cs.c View File

@ -1759,7 +1759,7 @@ static void cmm_cm4000_release(struct pcmcia_device * link)
/*==== 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;
@ -1846,7 +1846,7 @@ static void cm4000_config(struct pcmcia_device * link, int devno)
link->dev_node = &dev->node;
link->state &= ~DEV_CONFIG_PENDING;
return;
return 0;
cs_failed:
cs_error(link, fail_fn, fail_rc);
@ -1854,6 +1854,7 @@ cs_release:
cm4000_release(link);
link->state &= ~DEV_CONFIG_PENDING;
return -ENODEV;
}
static int cm4000_suspend(struct pcmcia_device *link)
@ -1883,10 +1884,10 @@ static void cm4000_release(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)
@ -1913,7 +1914,9 @@ static int cm4000_attach(struct pcmcia_device *link)
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);
@ -1968,7 +1971,7 @@ static struct pcmcia_driver cm4000_driver = {
.drv = {
.name = "cm4000_cs",
},
.probe = cm4000_attach,
.probe = cm4000_probe,
.remove = cm4000_detach,
.suspend = cm4000_suspend,
.resume = cm4000_resume,


+ 9
- 6
drivers/char/pcmcia/cm4040_cs.c View File

@ -514,7 +514,7 @@ static void cm4040_reader_release(struct pcmcia_device *link)
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;
@ -610,13 +610,14 @@ static void reader_config(struct pcmcia_device *link, int devno)
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)
@ -625,10 +626,10 @@ 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)
@ -659,7 +660,9 @@ static int reader_attach(struct pcmcia_device *link)
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);
@ -715,7 +718,7 @@ static struct pcmcia_driver reader_driver = {
.drv = {
.name = "cm4040_cs",
},
.probe = reader_attach,
.probe = reader_probe,
.remove = reader_detach,
.id_table = cm4040_ids,
};


+ 10
- 6
drivers/char/pcmcia/synclink_cs.c View File

@ -484,7 +484,7 @@ static void mgslpc_wait_until_sent(struct tty_struct *tty, int timeout);
/* 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);
@ -533,9 +533,10 @@ static void ldisc_receive_buf(struct tty_struct *tty,
}
}
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");
@ -578,7 +579,9 @@ static int mgslpc_attach(struct pcmcia_device *link)
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);
@ -591,7 +594,7 @@ static int mgslpc_attach(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 mgslpc_config(struct pcmcia_device *link)
static int mgslpc_config(struct pcmcia_device *link)
{
MGSLPC_INFO *info = link->priv;
tuple_t tuple;
@ -680,11 +683,12 @@ static void mgslpc_config(struct pcmcia_device *link)
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.
@ -3003,7 +3007,7 @@ static struct pcmcia_driver mgslpc_driver = {
.drv = {
.name = "synclink_cs",
},
.probe = mgslpc_attach,
.probe = mgslpc_probe,
.remove = mgslpc_detach,
.id_table = mgslpc_ids,
.suspend = mgslpc_suspend,


+ 7
- 8
drivers/ide/legacy/ide-cs.c View File

@ -88,7 +88,7 @@ typedef struct ide_info_t {
} 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);
@ -103,7 +103,7 @@ 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;
@ -126,9 +126,7 @@ static int ide_attach(struct pcmcia_device *link)
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 */
/*======================================================================
@ -172,7 +170,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq
#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;
@ -327,7 +325,7 @@ static void ide_config(struct pcmcia_device *link)
link->state &= ~DEV_CONFIG_PENDING;
kfree(stk);
return;
return 0;
err_mem:
printk(KERN_NOTICE "ide-cs: ide_config failed memory allocation\n");
@ -339,6 +337,7 @@ failed:
kfree(stk);
ide_release(link);
link->state &= ~DEV_CONFIG_PENDING;
return -ENODEV;
} /* ide_config */
/*======================================================================
@ -424,7 +423,7 @@ static struct pcmcia_driver ide_cs_driver = {
.drv = {
.name = "ide-cs",
},
.probe = ide_attach,
.probe = ide_probe,
.remove = ide_detach,
.id_table = ide_ids,
};


+ 10
- 11
drivers/isdn/hardware/avm/avm_cs.c View File

@ -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,
};


+ 9
- 10
drivers/isdn/hisax/avma1_cs.c View File

@ -67,7 +67,7 @@ module_param(isdnprot, int, 0);
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);
/*
@ -116,7 +116,7 @@ typedef struct local_info_t {
======================================================================*/
static int avma1cs_attach(struct pcmcia_device *p_dev)
static int avma1cs_probe(struct pcmcia_device *p_dev)
{
local_info_t *local;
@ -150,9 +150,7 @@ static int avma1cs_attach(struct pcmcia_device *p_dev)
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 */
/*======================================================================
@ -206,7 +204,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple,
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;
@ -242,7 +240,7 @@ static void avma1cs_config(struct pcmcia_device *link)
if (i != CS_SUCCESS) {
cs_error(link, ParseTuple, i);
link->state &= ~DEV_CONFIG_PENDING;
return;
return -ENODEV;
}
/* Configure card */
@ -325,7 +323,7 @@ found_port:
/* 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",
@ -340,10 +338,11 @@ found_port:
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 */
/*======================================================================
@ -379,7 +378,7 @@ static struct pcmcia_driver avma1cs_driver = {
.drv = {
.name = "avma1_cs",
},
.probe = avma1cs_attach,
.probe = avma1cs_probe,
.remove = avma1cs_detach,
.id_table = avma1cs_ids,
};


+ 7
- 8
drivers/isdn/hisax/elsa_cs.c View File

@ -94,7 +94,7 @@ module_param(protocol, int, 0);
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);
/*
@ -139,7 +139,7 @@ typedef struct local_info_t {
======================================================================*/
static int elsa_cs_attach(struct pcmcia_device *link)
static int elsa_cs_probe(struct pcmcia_device *link)
{
local_info_t *local;
@ -175,9 +175,7 @@ static int elsa_cs_attach(struct pcmcia_device *link)
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 */
/*======================================================================
@ -235,7 +233,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple,
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;
@ -346,10 +344,11 @@ static void elsa_cs_config(struct pcmcia_device *link)
} 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 */
/*======================================================================
@ -406,7 +405,7 @@ static struct pcmcia_driver elsa_cs_driver = {
.drv = {
.name = "elsa_cs",
},
.probe = elsa_cs_attach,
.probe = elsa_cs_probe,
.remove = elsa_cs_detach,
.id_table = elsa_ids,
.suspend = elsa_suspend,


+ 8
- 8
drivers/isdn/hisax/sedlbauer_cs.c View File

@ -95,7 +95,7 @@ module_param(protocol, int, 0);
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);
/*
@ -148,7 +148,7 @@ typedef struct local_info_t {
======================================================================*/
static int sedlbauer_attach(struct pcmcia_device *link)
static int sedlbauer_probe(struct pcmcia_device *link)
{
local_info_t *local;
@ -187,9 +187,7 @@ static int sedlbauer_attach(struct pcmcia_device *link)
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 */
/*======================================================================
@ -224,7 +222,7 @@ static void sedlbauer_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 sedlbauer_config(struct pcmcia_device *link)
static int sedlbauer_config(struct pcmcia_device *link)
{
local_info_t *dev = link->priv;
tuple_t tuple;
@ -423,14 +421,16 @@ static void sedlbauer_config(struct pcmcia_device *link)
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 */
@ -493,7 +493,7 @@ static struct pcmcia_driver sedlbauer_driver = {
.drv = {
.name = "sedlbauer_cs",
},
.probe = sedlbauer_attach,
.probe = sedlbauer_probe,
.remove = sedlbauer_detach,
.id_table = sedlbauer_ids,
.suspend = sedlbauer_suspend,


+ 11
- 10
drivers/isdn/hisax/teles_cs.c View File

@ -75,7 +75,7 @@ module_param(protocol, int, 0);
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);
/*
@ -130,7 +130,7 @@ typedef struct local_info_t {
======================================================================*/
static int teles_attach(struct pcmcia_device *link)
static int teles_probe(struct pcmcia_device *link)
{
local_info_t *local;
@ -165,9 +165,7 @@ static int teles_attach(struct pcmcia_device *link)
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 */
/*======================================================================
@ -225,7 +223,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple,
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;
@ -333,13 +331,16 @@ static void teles_cs_config(struct pcmcia_device *link)
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 */
/*======================================================================
@ -396,7 +397,7 @@ static struct pcmcia_driver teles_cs_driver = {
.drv = {
.name = "teles_cs",
},
.probe = teles_attach,
.probe = teles_probe,
.remove = teles_detach,
.id_table = teles_ids,
.suspend = teles_suspend,


+ 11
- 12
drivers/mtd/maps/pcmciamtd.c View File

@ -487,7 +487,7 @@ static void card_settings(struct pcmciamtd_dev *dev, 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 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;
@ -561,7 +561,7 @@ static void pcmciamtd_config(struct pcmcia_device *link)
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);
@ -573,7 +573,7 @@ static void pcmciamtd_config(struct pcmcia_device *link)
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);
@ -605,6 +605,7 @@ static void pcmciamtd_config(struct pcmcia_device *link)
ret = pcmcia_request_configuration(link, &link->conf);
if(ret != CS_SUCCESS) {
cs_error(link, RequestConfiguration, ret);
return -ENODEV;
}
if(mem_type == 1) {
@ -625,7 +626,7 @@ static void pcmciamtd_config(struct pcmcia_device *link)
if(!mtd) {
DEBUG(1, "Cant find an MTD");
pcmciamtd_release(link);
return;
return -ENODEV;
}
dev->mtd_info = mtd;
@ -668,19 +669,19 @@ static void pcmciamtd_config(struct pcmcia_device *link)
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;
}
@ -730,7 +731,7 @@ static void pcmciamtd_detach(struct pcmcia_device *link)
* with Card Services.
*/
static int pcmciamtd_attach(struct pcmcia_device *link)
static int pcmciamtd_probe(struct pcmcia_device *link)
{
struct pcmciamtd_dev *dev;
@ -747,9 +748,7 @@ static int pcmciamtd_attach(struct pcmcia_device *link)
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[] = {
@ -783,7 +782,7 @@ static struct pcmcia_driver pcmciamtd_driver = {
.drv = {
.name = "pcmciamtd"
},
.probe = pcmciamtd_attach,
.probe = pcmciamtd_probe,
.remove = pcmciamtd_detach,
.owner = THIS_MODULE,
.id_table = pcmciamtd_ids,


+ 7
- 9
drivers/net/pcmcia/3c574_cs.c View File

@ -225,7 +225,7 @@ static char mii_preamble_required = 0;
/* 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);
@ -256,7 +256,7 @@ static void tc574_detach(struct pcmcia_device *p_dev);
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;
@ -297,9 +297,7 @@ static int tc574_attach(struct pcmcia_device *link)
#endif
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
tc574_config(link);
return 0;
return tc574_config(link);
} /* tc574_attach */
/*
@ -337,7 +335,7 @@ static void tc574_detach(struct pcmcia_device *link)
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);
@ -486,13 +484,13 @@ static void tc574_config(struct pcmcia_device *link)
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 */
@ -1223,7 +1221,7 @@ static struct pcmcia_driver tc574_driver = {
.drv = {
.name = "3c574_cs",
},
.probe = tc574_attach,
.probe = tc574_probe,
.remove = tc574_detach,
.id_table = tc574_ids,
.suspend = tc574_suspend,


+ 7
- 10
drivers/net/pcmcia/3c589_cs.c View File

@ -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,


+ 7
- 9
drivers/net/pcmcia/axnet_cs.c View File

@ -86,7 +86,7 @@ static char *version =
/*====================================================================*/
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);
@ -142,7 +142,7 @@ static inline axnet_dev_t *PRIV(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;
@ -169,9 +169,7 @@ static int axnet_attach(struct pcmcia_device *link)
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 */
/*======================================================================
@ -288,7 +286,7 @@ static int try_io_port(struct pcmcia_device *link)
}
}
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);
@ -425,14 +423,14 @@ static void axnet_config(struct pcmcia_device *link)
} 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 */
/*======================================================================
@ -806,7 +804,7 @@ static struct pcmcia_driver axnet_cs_driver = {
.drv = {
.name = "axnet_cs",
},
.probe = axnet_attach,
.probe = axnet_probe,
.remove = axnet_detach,
.id_table = axnet_ids,
.suspend = axnet_suspend,


+ 7
- 8
drivers/net/pcmcia/com20020_cs.c View File

@ -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,


+ 7
- 9
drivers/net/pcmcia/fmvj18x_cs.c View File

@ -84,7 +84,7 @@ static char *version = DRV_NAME ".c " DRV_VERSION " 2002/03/23";
/*
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);
@ -228,7 +228,7 @@ typedef struct local_info_t {
#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;
@ -273,9 +273,7 @@ static int fmvj18x_attach(struct pcmcia_device *link)
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 */
/*====================================================================*/