Commit 12d1e75d authored by Matthias Kaehlcke's avatar Matthias Kaehlcke Committed by Linus Torvalds

Alchemy Semi Au1000 pcmcia driver: convert pcmcia_sockets_lock in a mutex

Alchemy Semi Au1000 pcmcia driver: The semaphore pcmcia_sockets_lock
is used as a mutex, convert it to the mutex API

(akpm: make it static too)
Signed-off-by: default avatarMatthias Kaehlcke <matthias@kaehlcke.net>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e772d782
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <linux/notifier.h> #include <linux/notifier.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -71,7 +72,7 @@ extern struct au1000_pcmcia_socket au1000_pcmcia_socket[]; ...@@ -71,7 +72,7 @@ extern struct au1000_pcmcia_socket au1000_pcmcia_socket[];
u32 *pcmcia_base_vaddrs[2]; u32 *pcmcia_base_vaddrs[2];
extern const unsigned long mips_io_port_base; extern const unsigned long mips_io_port_base;
DECLARE_MUTEX(pcmcia_sockets_lock); static DEFINE_MUTEX(pcmcia_sockets_lock);
static int (*au1x00_pcmcia_hw_init[])(struct device *dev) = { static int (*au1x00_pcmcia_hw_init[])(struct device *dev) = {
au1x_board_init, au1x_board_init,
...@@ -472,7 +473,7 @@ int au1x00_drv_pcmcia_remove(struct device *dev) ...@@ -472,7 +473,7 @@ int au1x00_drv_pcmcia_remove(struct device *dev)
struct skt_dev_info *sinfo = dev_get_drvdata(dev); struct skt_dev_info *sinfo = dev_get_drvdata(dev);
int i; int i;
down(&pcmcia_sockets_lock); mutex_lock(&pcmcia_sockets_lock);
dev_set_drvdata(dev, NULL); dev_set_drvdata(dev, NULL);
for (i = 0; i < sinfo->nskt; i++) { for (i = 0; i < sinfo->nskt; i++) {
...@@ -488,7 +489,7 @@ int au1x00_drv_pcmcia_remove(struct device *dev) ...@@ -488,7 +489,7 @@ int au1x00_drv_pcmcia_remove(struct device *dev)
} }
kfree(sinfo); kfree(sinfo);
up(&pcmcia_sockets_lock); mutex_unlock(&pcmcia_sockets_lock);
return 0; return 0;
} }
...@@ -501,13 +502,13 @@ static int au1x00_drv_pcmcia_probe(struct device *dev) ...@@ -501,13 +502,13 @@ static int au1x00_drv_pcmcia_probe(struct device *dev)
{ {
int i, ret = -ENODEV; int i, ret = -ENODEV;
down(&pcmcia_sockets_lock); mutex_lock(&pcmcia_sockets_lock);
for (i=0; i < ARRAY_SIZE(au1x00_pcmcia_hw_init); i++) { for (i=0; i < ARRAY_SIZE(au1x00_pcmcia_hw_init); i++) {
ret = au1x00_pcmcia_hw_init[i](dev); ret = au1x00_pcmcia_hw_init[i](dev);
if (ret == 0) if (ret == 0)
break; break;
} }
up(&pcmcia_sockets_lock); mutex_unlock(&pcmcia_sockets_lock);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment