Commit 15b99ac1 authored by Dominik Brodowski's avatar Dominik Brodowski

[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: 's avatarDominik Brodowski <linux@dominikbrodowski.net>
parent fba395ee
...@@ -85,7 +85,7 @@ typedef struct bluecard_info_t { ...@@ -85,7 +85,7 @@ typedef struct bluecard_info_t {
} 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_release(struct pcmcia_device *link);
static void bluecard_detach(struct pcmcia_device *p_dev); static void bluecard_detach(struct pcmcia_device *p_dev);
...@@ -856,7 +856,7 @@ static int bluecard_close(bluecard_info_t *info) ...@@ -856,7 +856,7 @@ static int bluecard_close(bluecard_info_t *info)
return 0; return 0;
} }
static int bluecard_attach(struct pcmcia_device *link) static int bluecard_probe(struct pcmcia_device *link)
{ {
bluecard_info_t *info; bluecard_info_t *info;
...@@ -880,9 +880,7 @@ static int bluecard_attach(struct pcmcia_device *link) ...@@ -880,9 +880,7 @@ static int bluecard_attach(struct pcmcia_device *link)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
bluecard_config(link); return bluecard_config(link);
return 0;
} }
...@@ -912,7 +910,7 @@ static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t ...@@ -912,7 +910,7 @@ static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t
return pcmcia_parse_tuple(handle, tuple, parse); 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; bluecard_info_t *info = link->priv;
tuple_t tuple; tuple_t tuple;
...@@ -973,13 +971,14 @@ static void bluecard_config(struct pcmcia_device *link) ...@@ -973,13 +971,14 @@ static void bluecard_config(struct pcmcia_device *link)
link->dev_node = &info->node; link->dev_node = &info->node;
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
return; return 0;
cs_failed: cs_failed:
cs_error(link, last_fn, last_ret); cs_error(link, last_fn, last_ret);
failed: failed:
bluecard_release(link); bluecard_release(link);
return -ENODEV;
} }
...@@ -1008,7 +1007,7 @@ static struct pcmcia_driver bluecard_driver = { ...@@ -1008,7 +1007,7 @@ static struct pcmcia_driver bluecard_driver = {
.drv = { .drv = {
.name = "bluecard_cs", .name = "bluecard_cs",
}, },
.probe = bluecard_attach, .probe = bluecard_probe,
.remove = bluecard_detach, .remove = bluecard_detach,
.id_table = bluecard_ids, .id_table = bluecard_ids,
}; };
......
...@@ -88,7 +88,7 @@ typedef struct bt3c_info_t { ...@@ -88,7 +88,7 @@ typedef struct bt3c_info_t {
} 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_release(struct pcmcia_device *link);
static void bt3c_detach(struct pcmcia_device *p_dev); static void bt3c_detach(struct pcmcia_device *p_dev);
...@@ -645,7 +645,7 @@ static int bt3c_close(bt3c_info_t *info) ...@@ -645,7 +645,7 @@ static int bt3c_close(bt3c_info_t *info)
return 0; return 0;
} }
static int bt3c_attach(struct pcmcia_device *link) static int bt3c_probe(struct pcmcia_device *link)
{ {
bt3c_info_t *info; bt3c_info_t *info;
...@@ -669,9 +669,7 @@ static int bt3c_attach(struct pcmcia_device *link) ...@@ -669,9 +669,7 @@ static int bt3c_attach(struct pcmcia_device *link)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
bt3c_config(link); return bt3c_config(link);
return 0;
} }
...@@ -710,7 +708,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t * ...@@ -710,7 +708,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *
return get_tuple(handle, tuple, parse); 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 }; static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
bt3c_info_t *info = link->priv; bt3c_info_t *info = link->priv;
...@@ -809,13 +807,14 @@ found_port: ...@@ -809,13 +807,14 @@ found_port:
link->dev_node = &info->node; link->dev_node = &info->node;
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
return; return 0;
cs_failed: cs_failed:
cs_error(link, last_fn, last_ret); cs_error(link, last_fn, last_ret);
failed: failed:
bt3c_release(link); bt3c_release(link);
return -ENODEV;
} }
...@@ -841,7 +840,7 @@ static struct pcmcia_driver bt3c_driver = { ...@@ -841,7 +840,7 @@ static struct pcmcia_driver bt3c_driver = {
.drv = { .drv = {
.name = "bt3c_cs", .name = "bt3c_cs",
}, },
.probe = bt3c_attach, .probe = bt3c_probe,
.remove = bt3c_detach, .remove = bt3c_detach,
.id_table = bt3c_ids, .id_table = bt3c_ids,
}; };
......
...@@ -84,7 +84,7 @@ typedef struct btuart_info_t { ...@@ -84,7 +84,7 @@ typedef struct btuart_info_t {
} 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_release(struct pcmcia_device *link);
static void btuart_detach(struct pcmcia_device *p_dev); static void btuart_detach(struct pcmcia_device *p_dev);
...@@ -576,7 +576,7 @@ static int btuart_close(btuart_info_t *info) ...@@ -576,7 +576,7 @@ static int btuart_close(btuart_info_t *info)
return 0; return 0;
} }
static int btuart_attach(struct pcmcia_device *link) static int btuart_probe(struct pcmcia_device *link)
{ {
btuart_info_t *info; btuart_info_t *info;
...@@ -600,9 +600,7 @@ static int btuart_attach(struct pcmcia_device *link) ...@@ -600,9 +600,7 @@ static int btuart_attach(struct pcmcia_device *link)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
btuart_config(link); return btuart_config(link);
return 0;
} }
...@@ -641,7 +639,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t * ...@@ -641,7 +639,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *
return get_tuple(handle, tuple, parse); 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 }; static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
btuart_info_t *info = link->priv; btuart_info_t *info = link->priv;
...@@ -741,13 +739,14 @@ found_port: ...@@ -741,13 +739,14 @@ found_port:
link->dev_node = &info->node; link->dev_node = &info->node;
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
return; return 0;
cs_failed: cs_failed:
cs_error(link, last_fn, last_ret); cs_error(link, last_fn, last_ret);
failed: failed:
btuart_release(link); btuart_release(link);
return -ENODEV;
} }
...@@ -772,7 +771,7 @@ static struct pcmcia_driver btuart_driver = { ...@@ -772,7 +771,7 @@ static struct pcmcia_driver btuart_driver = {
.drv = { .drv = {
.name = "btuart_cs", .name = "btuart_cs",
}, },
.probe = btuart_attach, .probe = btuart_probe,
.remove = btuart_detach, .remove = btuart_detach,
.id_table = btuart_ids, .id_table = btuart_ids,
}; };
......
...@@ -87,7 +87,7 @@ typedef struct dtl1_info_t { ...@@ -87,7 +87,7 @@ typedef struct dtl1_info_t {
} 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_release(struct pcmcia_device *link);
static void dtl1_detach(struct pcmcia_device *p_dev); static void dtl1_detach(struct pcmcia_device *p_dev);
...@@ -555,7 +555,7 @@ static int dtl1_close(dtl1_info_t *info) ...@@ -555,7 +555,7 @@ static int dtl1_close(dtl1_info_t *info)
return 0; return 0;
} }
static int dtl1_attach(struct pcmcia_device *link) static int dtl1_probe(struct pcmcia_device *link)
{ {
dtl1_info_t *info; dtl1_info_t *info;
...@@ -579,9 +579,7 @@ static int dtl1_attach(struct pcmcia_device *link) ...@@ -579,9 +579,7 @@ static int dtl1_attach(struct pcmcia_device *link)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
dtl1_config(link); return dtl1_config(link);
return 0;
} }
...@@ -620,7 +618,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t * ...@@ -620,7 +618,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *
return get_tuple(handle, tuple, parse); 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; dtl1_info_t *info = link->priv;
tuple_t tuple; tuple_t tuple;
...@@ -693,13 +691,14 @@ static void dtl1_config(struct pcmcia_device *link) ...@@ -693,13 +691,14 @@ static void dtl1_config(struct pcmcia_device *link)
link->dev_node = &info->node; link->dev_node = &info->node;
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
return; return 0;
cs_failed: cs_failed:
cs_error(link, last_fn, last_ret); cs_error(link, last_fn, last_ret);
failed: failed:
dtl1_release(link); dtl1_release(link);
return -ENODEV;
} }
...@@ -727,7 +726,7 @@ static struct pcmcia_driver dtl1_driver = { ...@@ -727,7 +726,7 @@ static struct pcmcia_driver dtl1_driver = {
.drv = { .drv = {
.name = "dtl1_cs", .name = "dtl1_cs",
}, },
.probe = dtl1_attach, .probe = dtl1_probe,
.remove = dtl1_detach, .remove = dtl1_detach,
.id_table = dtl1_ids, .id_table = dtl1_ids,
}; };
......
...@@ -1759,7 +1759,7 @@ static void cmm_cm4000_release(struct pcmcia_device * link) ...@@ -1759,7 +1759,7 @@ static void cmm_cm4000_release(struct pcmcia_device * link)
/*==== Interface to PCMCIA Layer =======================================*/ /*==== 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; struct cm4000_dev *dev;
tuple_t tuple; tuple_t tuple;
...@@ -1846,7 +1846,7 @@ static void cm4000_config(struct pcmcia_device * link, int devno) ...@@ -1846,7 +1846,7 @@ static void cm4000_config(struct pcmcia_device * link, int devno)
link->dev_node = &dev->node; link->dev_node = &dev->node;
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
return; return 0;
cs_failed: cs_failed:
cs_error(link, fail_fn, fail_rc); cs_error(link, fail_fn, fail_rc);
...@@ -1854,6 +1854,7 @@ cs_release: ...@@ -1854,6 +1854,7 @@ cs_release:
cm4000_release(link); cm4000_release(link);
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
return -ENODEV;
} }
static int cm4000_suspend(struct pcmcia_device *link) static int cm4000_suspend(struct pcmcia_device *link)
...@@ -1883,10 +1884,10 @@ static void cm4000_release(struct pcmcia_device *link) ...@@ -1883,10 +1884,10 @@ static void cm4000_release(struct pcmcia_device *link)
pcmcia_disable_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; struct cm4000_dev *dev;
int i; int i, ret;
for (i = 0; i < CM4000_MAX_DEV; i++) for (i = 0; i < CM4000_MAX_DEV; i++)
if (dev_table[i] == NULL) if (dev_table[i] == NULL)
...@@ -1913,7 +1914,9 @@ static int cm4000_attach(struct pcmcia_device *link) ...@@ -1913,7 +1914,9 @@ static int cm4000_attach(struct pcmcia_device *link)
init_waitqueue_head(&dev->readq); init_waitqueue_head(&dev->readq);
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 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, class_device_create(cmm_class, NULL, MKDEV(major, i), NULL,
"cmm%d", i); "cmm%d", i);
...@@ -1968,7 +1971,7 @@ static struct pcmcia_driver cm4000_driver = { ...@@ -1968,7 +1971,7 @@ static struct pcmcia_driver cm4000_driver = {
.drv = { .drv = {
.name = "cm4000_cs", .name = "cm4000_cs",
}, },
.probe = cm4000_attach, .probe = cm4000_probe,
.remove = cm4000_detach, .remove = cm4000_detach,
.suspend = cm4000_suspend, .suspend = cm4000_suspend,
.resume = cm4000_resume, .resume = cm4000_resume,
......
...@@ -514,7 +514,7 @@ static void cm4040_reader_release(struct pcmcia_device *link) ...@@ -514,7 +514,7 @@ static void cm4040_reader_release(struct pcmcia_device *link)
return; 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; struct reader_dev *dev;
tuple_t tuple; tuple_t tuple;
...@@ -610,13 +610,14 @@ static void reader_config(struct pcmcia_device *link, int devno) ...@@ -610,13 +610,14 @@ static void reader_config(struct pcmcia_device *link, int devno)
link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1); link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1);
DEBUGP(2, dev, "<- reader_config (succ)\n"); DEBUGP(2, dev, "<- reader_config (succ)\n");
return; return 0;
cs_failed: cs_failed:
cs_error(link, fail_fn, fail_rc); cs_error(link, fail_fn, fail_rc);
cs_release: cs_release:
reader_release(link); reader_release(link);
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
return -ENODEV;
} }
static void reader_release(struct pcmcia_device *link) static void reader_release(struct pcmcia_device *link)
...@@ -625,10 +626,10 @@ static void reader_release(struct pcmcia_device *link) ...@@ -625,10 +626,10 @@ static void reader_release(struct pcmcia_device *link)
pcmcia_disable_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; struct reader_dev *dev;
int i; int i, ret;
for (i = 0; i < CM_MAX_DEV; i++) { for (i = 0; i < CM_MAX_DEV; i++) {
if (dev_table[i] == NULL) if (dev_table[i] == NULL)
...@@ -659,7 +660,9 @@ static int reader_attach(struct pcmcia_device *link) ...@@ -659,7 +660,9 @@ static int reader_attach(struct pcmcia_device *link)
dev->poll_timer.function = &cm4040_do_poll; dev->poll_timer.function = &cm4040_do_poll;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 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, class_device_create(cmx_class, NULL, MKDEV(major, i), NULL,
"cmx%d", i); "cmx%d", i);
...@@ -715,7 +718,7 @@ static struct pcmcia_driver reader_driver = { ...@@ -715,7 +718,7 @@ static struct pcmcia_driver reader_driver = {
.drv = { .drv = {
.name = "cm4040_cs", .name = "cm4040_cs",
}, },
.probe = reader_attach, .probe = reader_probe,
.remove = reader_detach, .remove = reader_detach,
.id_table = cm4040_ids, .id_table = cm4040_ids,
}; };
......
...@@ -484,7 +484,7 @@ static void mgslpc_wait_until_sent(struct tty_struct *tty, int timeout); ...@@ -484,7 +484,7 @@ static void mgslpc_wait_until_sent(struct tty_struct *tty, int timeout);
/* PCMCIA prototypes */ /* 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_release(u_long arg);
static void mgslpc_detach(struct pcmcia_device *p_dev); static void mgslpc_detach(struct pcmcia_device *p_dev);
...@@ -533,9 +533,10 @@ static void ldisc_receive_buf(struct tty_struct *tty, ...@@ -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; MGSLPC_INFO *info;
int ret;
if (debug_level >= DEBUG_LEVEL_INFO) if (debug_level >= DEBUG_LEVEL_INFO)
printk("mgslpc_attach\n"); printk("mgslpc_attach\n");
...@@ -578,7 +579,9 @@ static int mgslpc_attach(struct pcmcia_device *link) ...@@ -578,7 +579,9 @@ static int mgslpc_attach(struct pcmcia_device *link)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
mgslpc_config(link); ret = mgslpc_config(link);
if (ret)
return ret;
mgslpc_add_device(info); mgslpc_add_device(info);
...@@ -591,7 +594,7 @@ static int mgslpc_attach(struct pcmcia_device *link) ...@@ -591,7 +594,7 @@ static int mgslpc_attach(struct pcmcia_device *link)
#define CS_CHECK(fn, ret) \ #define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 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; MGSLPC_INFO *info = link->priv;
tuple_t tuple; tuple_t tuple;
...@@ -680,11 +683,12 @@ static void mgslpc_config(struct pcmcia_device *link) ...@@ -680,11 +683,12 @@ static void mgslpc_config(struct pcmcia_device *link)
printk("\n"); printk("\n");
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
return; return 0;
cs_failed: cs_failed:
cs_error(link, last_fn, last_ret); cs_error(link, last_fn, last_ret);
mgslpc_release((u_long)link); mgslpc_release((u_long)link);
return -ENODEV;
} }
/* Card has been removed. /* Card has been removed.
...@@ -3003,7 +3007,7 @@ static struct pcmcia_driver mgslpc_driver = { ...@@ -3003,7 +3007,7 @@ static struct pcmcia_driver mgslpc_driver = {
.drv = { .drv = {
.name = "synclink_cs", .name = "synclink_cs",
}, },
.probe = mgslpc_attach, .probe = mgslpc_probe,
.remove = mgslpc_detach, .remove = mgslpc_detach,
.id_table = mgslpc_ids, .id_table = mgslpc_ids,
.suspend = mgslpc_suspend, .suspend = mgslpc_suspend,
......
...@@ -88,7 +88,7 @@ typedef struct ide_info_t { ...@@ -88,7 +88,7 @@ typedef struct ide_info_t {
} ide_info_t; } ide_info_t;
static void ide_release(struct pcmcia_device *); 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 void ide_detach(struct pcmcia_device *p_dev);
...@@ -103,7 +103,7 @@ 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; ide_info_t *info;
...@@ -126,9 +126,7 @@ static int ide_attach(struct pcmcia_device *link) ...@@ -126,9 +126,7 @@ static int ide_attach(struct pcmcia_device *link)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
ide_config(link); return ide_config(link);
return 0;
} /* ide_attach */ } /* ide_attach */
/*====================================================================== /*======================================================================
...@@ -172,7 +170,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq ...@@ -172,7 +170,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq
#define CS_CHECK(fn, ret) \ #define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 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; ide_info_t *info = link->priv;
tuple_t tuple; tuple_t tuple;
...@@ -327,7 +325,7 @@ static void ide_config(struct pcmcia_device *link) ...@@ -327,7 +325,7 @@ static void ide_config(struct pcmcia_device *link)
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
kfree(stk); kfree(stk);
return; return 0;
err_mem: err_mem:
printk(KERN_NOTICE "ide-cs: ide_config failed memory allocation\n"); printk(KERN_NOTICE "ide-cs: ide_config failed memory allocation\n");
...@@ -339,6 +337,7 @@ failed: ...@@ -339,6 +337,7 @@ failed:
kfree(stk); kfree(stk);
ide_release(link); ide_release(link);
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
return -ENODEV;
} /* ide_config */ } /* ide_config */
/*====================================================================== /*======================================================================
...@@ -424,7 +423,7 @@ static struct pcmcia_driver ide_cs_driver = { ...@@ -424,7 +423,7 @@ static struct pcmcia_driver ide_cs_driver = {
.drv = { .drv = {
.name = "ide-cs", .name = "ide-cs",
}, },
.probe = ide_attach, .probe = ide_probe,
.remove = ide_detach,