From 12d1e75d3d4d2748f5db308d9b5d5b873435c308 Mon Sep 17 00:00:00 2001 From: Matthias Kaehlcke Date: Thu, 1 May 2008 04:34:53 -0700 Subject: 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: Matthias Kaehlcke Cc: Ralf Baechle Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/pcmcia/au1000_generic.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c index b693367d38cd..75e8f8505e47 100644 --- a/drivers/pcmcia/au1000_generic.c +++ b/drivers/pcmcia/au1000_generic.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -71,7 +72,7 @@ extern struct au1000_pcmcia_socket au1000_pcmcia_socket[]; u32 *pcmcia_base_vaddrs[2]; 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) = { au1x_board_init, @@ -472,7 +473,7 @@ int au1x00_drv_pcmcia_remove(struct device *dev) struct skt_dev_info *sinfo = dev_get_drvdata(dev); int i; - down(&pcmcia_sockets_lock); + mutex_lock(&pcmcia_sockets_lock); dev_set_drvdata(dev, NULL); for (i = 0; i < sinfo->nskt; i++) { @@ -488,7 +489,7 @@ int au1x00_drv_pcmcia_remove(struct device *dev) } kfree(sinfo); - up(&pcmcia_sockets_lock); + mutex_unlock(&pcmcia_sockets_lock); return 0; } @@ -501,13 +502,13 @@ static int au1x00_drv_pcmcia_probe(struct device *dev) { int i, ret = -ENODEV; - down(&pcmcia_sockets_lock); + mutex_lock(&pcmcia_sockets_lock); for (i=0; i < ARRAY_SIZE(au1x00_pcmcia_hw_init); i++) { ret = au1x00_pcmcia_hw_init[i](dev); if (ret == 0) break; } - up(&pcmcia_sockets_lock); + mutex_unlock(&pcmcia_sockets_lock); return ret; } -- cgit v1.2.3