aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-01-15 19:14:38 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2010-02-17 11:48:17 -0500
commit64d8d46f5f501a19aec4db7ff93faf1b831d05ed (patch)
treeeae12e7cfea8259449eb14da6e449938773ac1fe /drivers
parent9e86749cff70fca505c7c1a9dc760d193f27a059 (diff)
pcmcia: properly lock skt->irq, skt->irq_mask
Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pcmcia/pcmcia_resource.c3
-rw-r--r--drivers/pcmcia/socket_sysfs.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index f365ecb9c5c..f0de7b8b123 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -419,7 +419,9 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
419 dev_dbg(&s->dev, "IRQ attributes must match assigned ones\n"); 419 dev_dbg(&s->dev, "IRQ attributes must match assigned ones\n");
420 return -EINVAL; 420 return -EINVAL;
421 } 421 }
422 mutex_lock(&s->ops_mutex);
422 if (s->irq.AssignedIRQ != req->AssignedIRQ) { 423 if (s->irq.AssignedIRQ != req->AssignedIRQ) {
424 mutex_unlock(&s->ops_mutex);
423 dev_dbg(&s->dev, "IRQ must match assigned one\n"); 425 dev_dbg(&s->dev, "IRQ must match assigned one\n");
424 return -EINVAL; 426 return -EINVAL;
425 } 427 }
@@ -434,6 +436,7 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
434#ifdef CONFIG_PCMCIA_PROBE 436#ifdef CONFIG_PCMCIA_PROBE
435 pcmcia_used_irq[req->AssignedIRQ]--; 437 pcmcia_used_irq[req->AssignedIRQ]--;
436#endif 438#endif
439 mutex_unlock(&s->ops_mutex);
437 440
438 return 0; 441 return 0;
439} /* pcmcia_release_irq */ 442} /* pcmcia_release_irq */
diff --git a/drivers/pcmcia/socket_sysfs.c b/drivers/pcmcia/socket_sysfs.c
index 537d79305e7..1cba9d38d81 100644
--- a/drivers/pcmcia/socket_sysfs.c
+++ b/drivers/pcmcia/socket_sysfs.c
@@ -167,7 +167,9 @@ static ssize_t pccard_store_irq_mask(struct device *dev,
167 ret = sscanf(buf, "0x%x\n", &mask); 167 ret = sscanf(buf, "0x%x\n", &mask);
168 168
169 if (ret == 1) { 169 if (ret == 1) {
170 mutex_lock(&s->ops_mutex);
170 s->irq_mask &= mask; 171 s->irq_mask &= mask;
172 mutex_unlock(&s->ops_mutex);
171 ret = 0; 173 ret = 0;
172 } 174 }
173 175