diff options
Diffstat (limited to 'drivers/parport')
-rw-r--r-- | drivers/parport/parport_cs.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c index 814c5252d703..05f34e73694b 100644 --- a/drivers/parport/parport_cs.c +++ b/drivers/parport/parport_cs.c | |||
@@ -151,9 +151,9 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | |||
151 | 151 | ||
152 | static int parport_config_check(struct pcmcia_device *p_dev, | 152 | static int parport_config_check(struct pcmcia_device *p_dev, |
153 | cistpl_cftable_entry_t *cfg, | 153 | cistpl_cftable_entry_t *cfg, |
154 | cistpl_cftable_entry_t *dflt, | ||
154 | void *priv_data) | 155 | void *priv_data) |
155 | { | 156 | { |
156 | cistpl_cftable_entry_t *dflt = priv_data; | ||
157 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | 157 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { |
158 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; | 158 | cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; |
159 | if (epp_mode) | 159 | if (epp_mode) |
@@ -166,26 +166,20 @@ static int parport_config_check(struct pcmcia_device *p_dev, | |||
166 | p_dev->io.NumPorts2 = io->win[1].len; | 166 | p_dev->io.NumPorts2 = io->win[1].len; |
167 | } | 167 | } |
168 | if (pcmcia_request_io(p_dev, &p_dev->io) != 0) | 168 | if (pcmcia_request_io(p_dev, &p_dev->io) != 0) |
169 | goto next_entry; | 169 | return -ENODEV; |
170 | return 0; | 170 | return 0; |
171 | } | 171 | } |
172 | |||
173 | next_entry: | ||
174 | if (cfg->flags & CISTPL_CFTABLE_DEFAULT) | ||
175 | *dflt = *cfg; | ||
176 | return -ENODEV; | ||
177 | } | 172 | } |
178 | 173 | ||
179 | static int parport_config(struct pcmcia_device *link) | 174 | static int parport_config(struct pcmcia_device *link) |
180 | { | 175 | { |
181 | parport_info_t *info = link->priv; | 176 | parport_info_t *info = link->priv; |
182 | cistpl_cftable_entry_t dflt = { 0 }; | ||
183 | struct parport *p; | 177 | struct parport *p; |
184 | int last_ret, last_fn; | 178 | int last_ret, last_fn; |
185 | 179 | ||
186 | DEBUG(0, "parport_config(0x%p)\n", link); | 180 | DEBUG(0, "parport_config(0x%p)\n", link); |
187 | 181 | ||
188 | last_ret = pcmcia_loop_config(link, parport_config_check, &dflt); | 182 | last_ret = pcmcia_loop_config(link, parport_config_check, NULL); |
189 | if (last_ret) { | 183 | if (last_ret) { |
190 | cs_error(link, RequestIO, last_ret); | 184 | cs_error(link, RequestIO, last_ret); |
191 | goto failed; | 185 | goto failed; |