diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-01-17 13:31:45 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-02-17 11:48:24 -0500 |
commit | cfe5d809518eda3d5e2da87c5ccbe8647143573a (patch) | |
tree | dd61ec285412fc0de8090ef5743b824447a9eeda /drivers/pcmcia/ds.c | |
parent | 3f565232c561fbd9d5e03354aac29b90cb2bc78a (diff) |
pcmcia: use ops_mutex for rsrc_{mgr,nonstatic} locking
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r-- | drivers/pcmcia/ds.c | 6 |
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) { |