aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/ds.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r--drivers/pcmcia/ds.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 253d9aca5f7..76a21638291 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -607,19 +607,23 @@ static int pcmcia_card_add(struct pcmcia_socket *s)
607{ 607{
608 cistpl_longlink_mfc_t mfc; 608 cistpl_longlink_mfc_t mfc;
609 unsigned int no_funcs, i, no_chains; 609 unsigned int no_funcs, i, no_chains;
610 int ret = 0; 610 int ret = -EAGAIN;
611 611
612 mutex_lock(&s->ops_mutex);
612 if (!(s->resource_setup_done)) { 613 if (!(s->resource_setup_done)) {
613 dev_dbg(&s->dev, 614 dev_dbg(&s->dev,
614 "no resources available, delaying card_add\n"); 615 "no resources available, delaying card_add\n");
616 mutex_unlock(&s->ops_mutex);
615 return -EAGAIN; /* try again, but later... */ 617 return -EAGAIN; /* try again, but later... */
616 } 618 }
617 619
618 if (pcmcia_validate_mem(s)) { 620 if (pcmcia_validate_mem(s)) {
619 dev_dbg(&s->dev, "validating mem resources failed, " 621 dev_dbg(&s->dev, "validating mem resources failed, "
620 "delaying card_add\n"); 622 "delaying card_add\n");
623 mutex_unlock(&s->ops_mutex);
621 return -EAGAIN; /* try again, but later... */ 624 return -EAGAIN; /* try again, but later... */
622 } 625 }
626 mutex_unlock(&s->ops_mutex);
623 627
624 ret = pccard_validate_cis(s, &no_chains); 628 ret = pccard_validate_cis(s, &no_chains);
625 if (ret || !no_chains) { 629 if (ret || !no_chains) {