diff options
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/soc_common.c | 15 | ||||
-rw-r--r-- | drivers/pcmcia/soc_common.h | 1 |
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c index aa7779d89752..78356481be93 100644 --- a/drivers/pcmcia/soc_common.c +++ b/drivers/pcmcia/soc_common.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/kernel.h> | 37 | #include <linux/kernel.h> |
38 | #include <linux/timer.h> | 38 | #include <linux/timer.h> |
39 | #include <linux/mm.h> | 39 | #include <linux/mm.h> |
40 | #include <linux/mutex.h> | ||
40 | #include <linux/interrupt.h> | 41 | #include <linux/interrupt.h> |
41 | #include <linux/irq.h> | 42 | #include <linux/irq.h> |
42 | #include <linux/spinlock.h> | 43 | #include <linux/spinlock.h> |
@@ -578,7 +579,7 @@ EXPORT_SYMBOL(soc_pcmcia_enable_irqs); | |||
578 | 579 | ||
579 | 580 | ||
580 | LIST_HEAD(soc_pcmcia_sockets); | 581 | LIST_HEAD(soc_pcmcia_sockets); |
581 | DECLARE_MUTEX(soc_pcmcia_sockets_lock); | 582 | static DEFINE_MUTEX(soc_pcmcia_sockets_lock); |
582 | 583 | ||
583 | static const char *skt_names[] = { | 584 | static const char *skt_names[] = { |
584 | "PCMCIA socket 0", | 585 | "PCMCIA socket 0", |
@@ -601,11 +602,11 @@ soc_pcmcia_notifier(struct notifier_block *nb, unsigned long val, void *data) | |||
601 | struct cpufreq_freqs *freqs = data; | 602 | struct cpufreq_freqs *freqs = data; |
602 | int ret = 0; | 603 | int ret = 0; |
603 | 604 | ||
604 | down(&soc_pcmcia_sockets_lock); | 605 | mutex_lock(&soc_pcmcia_sockets_lock); |
605 | list_for_each_entry(skt, &soc_pcmcia_sockets, node) | 606 | list_for_each_entry(skt, &soc_pcmcia_sockets, node) |
606 | if ( skt->ops->frequency_change ) | 607 | if ( skt->ops->frequency_change ) |
607 | ret += skt->ops->frequency_change(skt, val, freqs); | 608 | ret += skt->ops->frequency_change(skt, val, freqs); |
608 | up(&soc_pcmcia_sockets_lock); | 609 | mutex_unlock(&soc_pcmcia_sockets_lock); |
609 | 610 | ||
610 | return ret; | 611 | return ret; |
611 | } | 612 | } |
@@ -642,7 +643,7 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops | |||
642 | struct soc_pcmcia_socket *skt; | 643 | struct soc_pcmcia_socket *skt; |
643 | int ret, i; | 644 | int ret, i; |
644 | 645 | ||
645 | down(&soc_pcmcia_sockets_lock); | 646 | mutex_lock(&soc_pcmcia_sockets_lock); |
646 | 647 | ||
647 | sinfo = kzalloc(SKT_DEV_INFO_SIZE(nr), GFP_KERNEL); | 648 | sinfo = kzalloc(SKT_DEV_INFO_SIZE(nr), GFP_KERNEL); |
648 | if (!sinfo) { | 649 | if (!sinfo) { |
@@ -782,7 +783,7 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops | |||
782 | kfree(sinfo); | 783 | kfree(sinfo); |
783 | 784 | ||
784 | out: | 785 | out: |
785 | up(&soc_pcmcia_sockets_lock); | 786 | mutex_unlock(&soc_pcmcia_sockets_lock); |
786 | return ret; | 787 | return ret; |
787 | } | 788 | } |
788 | 789 | ||
@@ -793,7 +794,7 @@ int soc_common_drv_pcmcia_remove(struct device *dev) | |||
793 | 794 | ||
794 | dev_set_drvdata(dev, NULL); | 795 | dev_set_drvdata(dev, NULL); |
795 | 796 | ||
796 | down(&soc_pcmcia_sockets_lock); | 797 | mutex_lock(&soc_pcmcia_sockets_lock); |
797 | for (i = 0; i < sinfo->nskt; i++) { | 798 | for (i = 0; i < sinfo->nskt; i++) { |
798 | struct soc_pcmcia_socket *skt = &sinfo->skt[i]; | 799 | struct soc_pcmcia_socket *skt = &sinfo->skt[i]; |
799 | 800 | ||
@@ -818,7 +819,7 @@ int soc_common_drv_pcmcia_remove(struct device *dev) | |||
818 | if (list_empty(&soc_pcmcia_sockets)) | 819 | if (list_empty(&soc_pcmcia_sockets)) |
819 | soc_pcmcia_cpufreq_unregister(); | 820 | soc_pcmcia_cpufreq_unregister(); |
820 | 821 | ||
821 | up(&soc_pcmcia_sockets_lock); | 822 | mutex_unlock(&soc_pcmcia_sockets_lock); |
822 | 823 | ||
823 | kfree(sinfo); | 824 | kfree(sinfo); |
824 | 825 | ||
diff --git a/drivers/pcmcia/soc_common.h b/drivers/pcmcia/soc_common.h index 6f14126889b3..1edc1da9d353 100644 --- a/drivers/pcmcia/soc_common.h +++ b/drivers/pcmcia/soc_common.h | |||
@@ -133,7 +133,6 @@ extern void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *, struct soc_ | |||
133 | 133 | ||
134 | 134 | ||
135 | extern struct list_head soc_pcmcia_sockets; | 135 | extern struct list_head soc_pcmcia_sockets; |
136 | extern struct semaphore soc_pcmcia_sockets_lock; | ||
137 | 136 | ||
138 | extern int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr); | 137 | extern int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr); |
139 | extern int soc_common_drv_pcmcia_remove(struct device *dev); | 138 | extern int soc_common_drv_pcmcia_remove(struct device *dev); |