diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-01-17 19:31:45 +0100 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-02-17 17:48:24 +0100 |
commit | cfe5d809518eda3d5e2da87c5ccbe8647143573a (patch) | |
tree | dd61ec285412fc0de8090ef5743b824447a9eeda /drivers/pcmcia/ds.c | |
parent | 3f565232c561fbd9d5e03354aac29b90cb2bc78a (diff) | |
download | blackbird-op-linux-cfe5d809518eda3d5e2da87c5ccbe8647143573a.tar.gz blackbird-op-linux-cfe5d809518eda3d5e2da87c5ccbe8647143573a.zip |
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 253d9aca5f77..76a21638291b 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -607,19 +607,23 @@ static int pcmcia_card_add(struct pcmcia_socket *s) { cistpl_longlink_mfc_t mfc; unsigned int no_funcs, i, no_chains; - int ret = 0; + int ret = -EAGAIN; + mutex_lock(&s->ops_mutex); if (!(s->resource_setup_done)) { dev_dbg(&s->dev, "no resources available, delaying card_add\n"); + mutex_unlock(&s->ops_mutex); return -EAGAIN; /* try again, but later... */ } if (pcmcia_validate_mem(s)) { dev_dbg(&s->dev, "validating mem resources failed, " "delaying card_add\n"); + mutex_unlock(&s->ops_mutex); return -EAGAIN; /* try again, but later... */ } + mutex_unlock(&s->ops_mutex); ret = pccard_validate_cis(s, &no_chains); if (ret || !no_chains) { |