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/ide/legacy | |
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/ide/legacy')
-rw-r--r-- | drivers/ide/legacy/ide-cs.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c index 58690c1ff6ba..56c8e828c6e6 100644 --- a/drivers/ide/legacy/ide-cs.c +++ b/drivers/ide/legacy/ide-cs.c | |||
@@ -88,7 +88,7 @@ typedef struct ide_info_t { | |||
88 | } ide_info_t; | 88 | } ide_info_t; |
89 | 89 | ||
90 | static void ide_release(struct pcmcia_device *); | 90 | static void ide_release(struct pcmcia_device *); |
91 | static void ide_config(struct pcmcia_device *); | 91 | static int ide_config(struct pcmcia_device *); |
92 | 92 | ||
93 | static void ide_detach(struct pcmcia_device *p_dev); | 93 | static void ide_detach(struct pcmcia_device *p_dev); |
94 | 94 | ||
@@ -103,7 +103,7 @@ static void ide_detach(struct pcmcia_device *p_dev); | |||
103 | 103 | ||
104 | ======================================================================*/ | 104 | ======================================================================*/ |
105 | 105 | ||
106 | static int ide_attach(struct pcmcia_device *link) | 106 | static int ide_probe(struct pcmcia_device *link) |
107 | { | 107 | { |
108 | ide_info_t *info; | 108 | ide_info_t *info; |
109 | 109 | ||
@@ -126,9 +126,7 @@ static int ide_attach(struct pcmcia_device *link) | |||
126 | link->conf.IntType = INT_MEMORY_AND_IO; | 126 | link->conf.IntType = INT_MEMORY_AND_IO; |
127 | 127 | ||
128 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 128 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
129 | ide_config(link); | 129 | return ide_config(link); |
130 | |||
131 | return 0; | ||
132 | } /* ide_attach */ | 130 | } /* ide_attach */ |
133 | 131 | ||
134 | /*====================================================================== | 132 | /*====================================================================== |
@@ -172,7 +170,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq | |||
172 | #define CS_CHECK(fn, ret) \ | 170 | #define CS_CHECK(fn, ret) \ |
173 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 171 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
174 | 172 | ||
175 | static void ide_config(struct pcmcia_device *link) | 173 | static int ide_config(struct pcmcia_device *link) |
176 | { | 174 | { |
177 | ide_info_t *info = link->priv; | 175 | ide_info_t *info = link->priv; |
178 | tuple_t tuple; | 176 | tuple_t tuple; |
@@ -327,7 +325,7 @@ static void ide_config(struct pcmcia_device *link) | |||
327 | 325 | ||
328 | link->state &= ~DEV_CONFIG_PENDING; | 326 | link->state &= ~DEV_CONFIG_PENDING; |
329 | kfree(stk); | 327 | kfree(stk); |
330 | return; | 328 | return 0; |
331 | 329 | ||
332 | err_mem: | 330 | err_mem: |
333 | printk(KERN_NOTICE "ide-cs: ide_config failed memory allocation\n"); | 331 | printk(KERN_NOTICE "ide-cs: ide_config failed memory allocation\n"); |
@@ -339,6 +337,7 @@ failed: | |||
339 | kfree(stk); | 337 | kfree(stk); |
340 | ide_release(link); | 338 | ide_release(link); |
341 | link->state &= ~DEV_CONFIG_PENDING; | 339 | link->state &= ~DEV_CONFIG_PENDING; |
340 | return -ENODEV; | ||
342 | } /* ide_config */ | 341 | } /* ide_config */ |
343 | 342 | ||
344 | /*====================================================================== | 343 | /*====================================================================== |
@@ -424,7 +423,7 @@ static struct pcmcia_driver ide_cs_driver = { | |||
424 | .drv = { | 423 | .drv = { |
425 | .name = "ide-cs", | 424 | .name = "ide-cs", |
426 | }, | 425 | }, |
427 | .probe = ide_attach, | 426 | .probe = ide_probe, |
428 | .remove = ide_detach, | 427 | .remove = ide_detach, |
429 | .id_table = ide_ids, | 428 | .id_table = ide_ids, |
430 | }; | 429 | }; |