diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pcmcia/pcmcia_resource.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index cc3402c9b2c3..3131bb0a0095 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c | |||
@@ -208,7 +208,6 @@ int pccard_get_configuration_info(struct pcmcia_socket *s, | |||
208 | if (!(s->state & SOCKET_PRESENT)) | 208 | if (!(s->state & SOCKET_PRESENT)) |
209 | return CS_NO_CARD; | 209 | return CS_NO_CARD; |
210 | 210 | ||
211 | config->Function = p_dev->func; | ||
212 | 211 | ||
213 | #ifdef CONFIG_CARDBUS | 212 | #ifdef CONFIG_CARDBUS |
214 | if (s->state & SOCKET_CARDBUS) { | 213 | if (s->state & SOCKET_CARDBUS) { |
@@ -222,14 +221,22 @@ int pccard_get_configuration_info(struct pcmcia_socket *s, | |||
222 | config->AssignedIRQ = s->irq.AssignedIRQ; | 221 | config->AssignedIRQ = s->irq.AssignedIRQ; |
223 | if (config->AssignedIRQ) | 222 | if (config->AssignedIRQ) |
224 | config->Attributes |= CONF_ENABLE_IRQ; | 223 | config->Attributes |= CONF_ENABLE_IRQ; |
225 | config->BasePort1 = s->io[0].res->start; | 224 | if (s->io[0].res) { |
226 | config->NumPorts1 = s->io[0].res->end - config->BasePort1 + 1; | 225 | config->BasePort1 = s->io[0].res->start; |
226 | config->NumPorts1 = s->io[0].res->end - config->BasePort1 + 1; | ||
227 | } | ||
227 | } | 228 | } |
228 | return CS_SUCCESS; | 229 | return CS_SUCCESS; |
229 | } | 230 | } |
230 | #endif | 231 | #endif |
231 | 232 | ||
232 | c = (p_dev) ? p_dev->function_config : NULL; | 233 | if (p_dev) { |
234 | c = p_dev->function_config; | ||
235 | config->Function = p_dev->func; | ||
236 | } else { | ||
237 | c = NULL; | ||
238 | config->Function = 0; | ||
239 | } | ||
233 | 240 | ||
234 | if ((c == NULL) || !(c->state & CONFIG_LOCKED)) { | 241 | if ((c == NULL) || !(c->state & CONFIG_LOCKED)) { |
235 | config->Attributes = 0; | 242 | config->Attributes = 0; |