diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-01-10 15:20:36 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:02:19 -0500 |
commit | 7fe908dd11e0c947bb72baa5b001d7abe5a420d5 (patch) | |
tree | dbd6db7a79476aee256a453f33bbe08c6b3a0cc1 /drivers/pcmcia/ds.c | |
parent | cbbddd1046d44d90d31c7f246ed0207117602b89 (diff) |
[PATCH] pcmcia: use mutexes instead of semaphores
Use mutexes in the PCMICA core, as they suffice for what needs to be done.
Includes a bugfix from and Signed-off-by Andrew Morton.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r-- | drivers/pcmcia/ds.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 37ba1246c282..3b7e1ba13c78 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -564,7 +564,7 @@ static int pcmcia_device_query(struct pcmcia_device *p_dev) | |||
564 | * won't work, this doesn't matter much at the moment: the driver core doesn't | 564 | * won't work, this doesn't matter much at the moment: the driver core doesn't |
565 | * support it either. | 565 | * support it either. |
566 | */ | 566 | */ |
567 | static DECLARE_MUTEX(device_add_lock); | 567 | static DEFINE_MUTEX(device_add_lock); |
568 | 568 | ||
569 | struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int function) | 569 | struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int function) |
570 | { | 570 | { |
@@ -576,7 +576,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f | |||
576 | if (!s) | 576 | if (!s) |
577 | return NULL; | 577 | return NULL; |
578 | 578 | ||
579 | down(&device_add_lock); | 579 | mutex_lock(&device_add_lock); |
580 | 580 | ||
581 | /* max of 2 devices per card */ | 581 | /* max of 2 devices per card */ |
582 | if (s->device_count == 2) | 582 | if (s->device_count == 2) |
@@ -640,7 +640,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f | |||
640 | if (device_register(&p_dev->dev)) | 640 | if (device_register(&p_dev->dev)) |
641 | goto err_unreg; | 641 | goto err_unreg; |
642 | 642 | ||
643 | up(&device_add_lock); | 643 | mutex_unlock(&device_add_lock); |
644 | 644 | ||
645 | return p_dev; | 645 | return p_dev; |
646 | 646 | ||
@@ -654,7 +654,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f | |||
654 | kfree(p_dev); | 654 | kfree(p_dev); |
655 | s->device_count--; | 655 | s->device_count--; |
656 | err_put: | 656 | err_put: |
657 | up(&device_add_lock); | 657 | mutex_unlock(&device_add_lock); |
658 | pcmcia_put_socket(s); | 658 | pcmcia_put_socket(s); |
659 | 659 | ||
660 | return NULL; | 660 | return NULL; |
@@ -713,7 +713,7 @@ static void pcmcia_bus_rescan(struct pcmcia_socket *skt) | |||
713 | int no_devices=0; | 713 | int no_devices=0; |
714 | unsigned long flags; | 714 | unsigned long flags; |
715 | 715 | ||
716 | /* must be called with skt_sem held */ | 716 | /* must be called with skt_mutex held */ |
717 | spin_lock_irqsave(&pcmcia_dev_list_lock, flags); | 717 | spin_lock_irqsave(&pcmcia_dev_list_lock, flags); |
718 | if (list_empty(&skt->devices_list)) | 718 | if (list_empty(&skt->devices_list)) |
719 | no_devices=1; | 719 | no_devices=1; |
@@ -999,9 +999,9 @@ static ssize_t pcmcia_store_allow_func_id_match(struct device *dev, | |||
999 | if (!count) | 999 | if (!count) |
1000 | return -EINVAL; | 1000 | return -EINVAL; |
1001 | 1001 | ||
1002 | down(&p_dev->socket->skt_sem); | 1002 | mutex_lock(&p_dev->socket->skt_mutex); |
1003 | p_dev->allow_func_id_match = 1; | 1003 | p_dev->allow_func_id_match = 1; |
1004 | up(&p_dev->socket->skt_sem); | 1004 | mutex_unlock(&p_dev->socket->skt_mutex); |
1005 | 1005 | ||
1006 | bus_rescan_devices(&pcmcia_bus_type); | 1006 | bus_rescan_devices(&pcmcia_bus_type); |
1007 | 1007 | ||