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/parport | |
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/parport')
-rw-r--r-- | drivers/parport/parport_cs.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c index 6dcaf44c120a..e4be826c48ba 100644 --- a/drivers/parport/parport_cs.c +++ b/drivers/parport/parport_cs.c | |||
@@ -88,7 +88,7 @@ typedef struct parport_info_t { | |||
88 | } parport_info_t; | 88 | } parport_info_t; |
89 | 89 | ||
90 | static void parport_detach(struct pcmcia_device *p_dev); | 90 | static void parport_detach(struct pcmcia_device *p_dev); |
91 | static void parport_config(struct pcmcia_device *link); | 91 | static int parport_config(struct pcmcia_device *link); |
92 | static void parport_cs_release(struct pcmcia_device *); | 92 | static void parport_cs_release(struct pcmcia_device *); |
93 | 93 | ||
94 | /*====================================================================== | 94 | /*====================================================================== |
@@ -99,7 +99,7 @@ static void parport_cs_release(struct pcmcia_device *); | |||
99 | 99 | ||
100 | ======================================================================*/ | 100 | ======================================================================*/ |
101 | 101 | ||
102 | static int parport_attach(struct pcmcia_device *link) | 102 | static int parport_probe(struct pcmcia_device *link) |
103 | { | 103 | { |
104 | parport_info_t *info; | 104 | parport_info_t *info; |
105 | 105 | ||
@@ -120,9 +120,7 @@ static int parport_attach(struct pcmcia_device *link) | |||
120 | link->conf.IntType = INT_MEMORY_AND_IO; | 120 | link->conf.IntType = INT_MEMORY_AND_IO; |
121 | 121 | ||
122 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 122 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
123 | parport_config(link); | 123 | return parport_config(link); |
124 | |||
125 | return 0; | ||
126 | } /* parport_attach */ | 124 | } /* parport_attach */ |
127 | 125 | ||
128 | /*====================================================================== | 126 | /*====================================================================== |
@@ -155,7 +153,7 @@ static void parport_detach(struct pcmcia_device *link) | |||
155 | #define CS_CHECK(fn, ret) \ | 153 | #define CS_CHECK(fn, ret) \ |
156 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 154 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
157 | 155 | ||
158 | void parport_config(struct pcmcia_device *link) | 156 | static int parport_config(struct pcmcia_device *link) |
159 | { | 157 | { |
160 | parport_info_t *info = link->priv; | 158 | parport_info_t *info = link->priv; |
161 | tuple_t tuple; | 159 | tuple_t tuple; |
@@ -236,14 +234,14 @@ void parport_config(struct pcmcia_device *link) | |||
236 | link->dev_node = &info->node; | 234 | link->dev_node = &info->node; |
237 | 235 | ||
238 | link->state &= ~DEV_CONFIG_PENDING; | 236 | link->state &= ~DEV_CONFIG_PENDING; |
239 | return; | 237 | return 0; |
240 | 238 | ||
241 | cs_failed: | 239 | cs_failed: |
242 | cs_error(link, last_fn, last_ret); | 240 | cs_error(link, last_fn, last_ret); |
243 | failed: | 241 | failed: |
244 | parport_cs_release(link); | 242 | parport_cs_release(link); |
245 | link->state &= ~DEV_CONFIG_PENDING; | 243 | link->state &= ~DEV_CONFIG_PENDING; |
246 | 244 | return -ENODEV; | |
247 | } /* parport_config */ | 245 | } /* parport_config */ |
248 | 246 | ||
249 | /*====================================================================== | 247 | /*====================================================================== |
@@ -282,7 +280,7 @@ static struct pcmcia_driver parport_cs_driver = { | |||
282 | .drv = { | 280 | .drv = { |
283 | .name = "parport_cs", | 281 | .name = "parport_cs", |
284 | }, | 282 | }, |
285 | .probe = parport_attach, | 283 | .probe = parport_probe, |
286 | .remove = parport_detach, | 284 | .remove = parport_detach, |
287 | .id_table = parport_ids, | 285 | .id_table = parport_ids, |
288 | }; | 286 | }; |