aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pcmcia/au1000_generic.c11
1 files changed, 6 insertions, 5 deletions
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 @@
41#include <linux/notifier.h> 41#include <linux/notifier.h>
42#include <linux/interrupt.h> 42#include <linux/interrupt.h>
43#include <linux/spinlock.h> 43#include <linux/spinlock.h>
44#include <linux/mutex.h>
44#include <linux/platform_device.h> 45#include <linux/platform_device.h>
45 46
46#include <asm/io.h> 47#include <asm/io.h>
@@ -71,7 +72,7 @@ extern struct au1000_pcmcia_socket au1000_pcmcia_socket[];
71u32 *pcmcia_base_vaddrs[2]; 72u32 *pcmcia_base_vaddrs[2];
72extern const unsigned long mips_io_port_base; 73extern const unsigned long mips_io_port_base;
73 74
74DECLARE_MUTEX(pcmcia_sockets_lock); 75static DEFINE_MUTEX(pcmcia_sockets_lock);
75 76
76static int (*au1x00_pcmcia_hw_init[])(struct device *dev) = { 77static int (*au1x00_pcmcia_hw_init[])(struct device *dev) = {
77 au1x_board_init, 78 au1x_board_init,
@@ -472,7 +473,7 @@ int au1x00_drv_pcmcia_remove(struct device *dev)
472 struct skt_dev_info *sinfo = dev_get_drvdata(dev); 473 struct skt_dev_info *sinfo = dev_get_drvdata(dev);
473 int i; 474 int i;
474 475
475 down(&pcmcia_sockets_lock); 476 mutex_lock(&pcmcia_sockets_lock);
476 dev_set_drvdata(dev, NULL); 477 dev_set_drvdata(dev, NULL);
477 478
478 for (i = 0; i < sinfo->nskt; i++) { 479 for (i = 0; i < sinfo->nskt; i++) {
@@ -488,7 +489,7 @@ int au1x00_drv_pcmcia_remove(struct device *dev)
488 } 489 }
489 490
490 kfree(sinfo); 491 kfree(sinfo);
491 up(&pcmcia_sockets_lock); 492 mutex_unlock(&pcmcia_sockets_lock);
492 return 0; 493 return 0;
493} 494}
494 495
@@ -501,13 +502,13 @@ static int au1x00_drv_pcmcia_probe(struct device *dev)
501{ 502{
502 int i, ret = -ENODEV; 503 int i, ret = -ENODEV;
503 504
504 down(&pcmcia_sockets_lock); 505 mutex_lock(&pcmcia_sockets_lock);
505 for (i=0; i < ARRAY_SIZE(au1x00_pcmcia_hw_init); i++) { 506 for (i=0; i < ARRAY_SIZE(au1x00_pcmcia_hw_init); i++) {
506 ret = au1x00_pcmcia_hw_init[i](dev); 507 ret = au1x00_pcmcia_hw_init[i](dev);
507 if (ret == 0) 508 if (ret == 0)
508 break; 509 break;
509 } 510 }
510 up(&pcmcia_sockets_lock); 511 mutex_unlock(&pcmcia_sockets_lock);
511 return ret; 512 return ret;
512} 513}
513 514