diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:26:06 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:26:06 -0500 |
commit | 15b99ac1729503db9e6dc642a50b9b6cb3bf51f9 (patch) | |
tree | cfb8897487beba502aac2b28bc35066a87e34299 /drivers/serial/serial_cs.c | |
parent | fba395eee7d3f342ca739c20f5b3ee635d0420a0 (diff) |
[PATCH] pcmcia: add return value to _config() functions
Most of the driver initialization isn't done in the .probe function, but in
the internal _config() functions. Make them return a value, so that .probe
can properly report whether the probing of the device succeeded or not.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/serial/serial_cs.c')
-rw-r--r-- | drivers/serial/serial_cs.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c index 1fe8cafebe38..e7875090dc4c 100644 --- a/drivers/serial/serial_cs.c +++ b/drivers/serial/serial_cs.c | |||
@@ -113,7 +113,7 @@ struct serial_cfg_mem { | |||
113 | }; | 113 | }; |
114 | 114 | ||
115 | 115 | ||
116 | static void serial_config(struct pcmcia_device * link); | 116 | static int serial_config(struct pcmcia_device * link); |
117 | 117 | ||
118 | 118 | ||
119 | /*====================================================================== | 119 | /*====================================================================== |
@@ -211,9 +211,7 @@ static int serial_probe(struct pcmcia_device *link) | |||
211 | link->conf.IntType = INT_MEMORY_AND_IO; | 211 | link->conf.IntType = INT_MEMORY_AND_IO; |
212 | 212 | ||
213 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 213 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
214 | serial_config(link); | 214 | return serial_config(link); |
215 | |||
216 | return 0; | ||
217 | } | 215 | } |
218 | 216 | ||
219 | /*====================================================================== | 217 | /*====================================================================== |
@@ -553,7 +551,7 @@ free_cfg_mem: | |||
553 | 551 | ||
554 | ======================================================================*/ | 552 | ======================================================================*/ |
555 | 553 | ||
556 | void serial_config(struct pcmcia_device * link) | 554 | static int serial_config(struct pcmcia_device * link) |
557 | { | 555 | { |
558 | struct serial_info *info = link->priv; | 556 | struct serial_info *info = link->priv; |
559 | struct serial_cfg_mem *cfg_mem; | 557 | struct serial_cfg_mem *cfg_mem; |
@@ -652,7 +650,7 @@ void serial_config(struct pcmcia_device * link) | |||
652 | link->dev_node = &info->node[0]; | 650 | link->dev_node = &info->node[0]; |
653 | link->state &= ~DEV_CONFIG_PENDING; | 651 | link->state &= ~DEV_CONFIG_PENDING; |
654 | kfree(cfg_mem); | 652 | kfree(cfg_mem); |
655 | return; | 653 | return 0; |
656 | 654 | ||
657 | cs_failed: | 655 | cs_failed: |
658 | cs_error(link, last_fn, last_ret); | 656 | cs_error(link, last_fn, last_ret); |
@@ -660,6 +658,7 @@ void serial_config(struct pcmcia_device * link) | |||
660 | serial_remove(link); | 658 | serial_remove(link); |
661 | link->state &= ~DEV_CONFIG_PENDING; | 659 | link->state &= ~DEV_CONFIG_PENDING; |
662 | kfree(cfg_mem); | 660 | kfree(cfg_mem); |
661 | return -ENODEV; | ||
663 | } | 662 | } |
664 | 663 | ||
665 | static struct pcmcia_device_id serial_ids[] = { | 664 | static struct pcmcia_device_id serial_ids[] = { |