diff options
Diffstat (limited to 'drivers/char/watchdog/pcwd_usb.c')
-rw-r--r-- | drivers/char/watchdog/pcwd_usb.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/char/watchdog/pcwd_usb.c b/drivers/char/watchdog/pcwd_usb.c index 1533f56baa42..2700c5c45b8a 100644 --- a/drivers/char/watchdog/pcwd_usb.c +++ b/drivers/char/watchdog/pcwd_usb.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/completion.h> | 42 | #include <linux/completion.h> |
43 | #include <asm/uaccess.h> | 43 | #include <asm/uaccess.h> |
44 | #include <linux/usb.h> | 44 | #include <linux/usb.h> |
45 | #include <linux/mutex.h> | ||
45 | 46 | ||
46 | 47 | ||
47 | #ifdef CONFIG_USB_DEBUG | 48 | #ifdef CONFIG_USB_DEBUG |
@@ -143,7 +144,7 @@ struct usb_pcwd_private { | |||
143 | static struct usb_pcwd_private *usb_pcwd_device; | 144 | static struct usb_pcwd_private *usb_pcwd_device; |
144 | 145 | ||
145 | /* prevent races between open() and disconnect() */ | 146 | /* prevent races between open() and disconnect() */ |
146 | static DECLARE_MUTEX (disconnect_sem); | 147 | static DEFINE_MUTEX(disconnect_mutex); |
147 | 148 | ||
148 | /* local function prototypes */ | 149 | /* local function prototypes */ |
149 | static int usb_pcwd_probe (struct usb_interface *interface, const struct usb_device_id *id); | 150 | static int usb_pcwd_probe (struct usb_interface *interface, const struct usb_device_id *id); |
@@ -723,7 +724,7 @@ static void usb_pcwd_disconnect(struct usb_interface *interface) | |||
723 | struct usb_pcwd_private *usb_pcwd; | 724 | struct usb_pcwd_private *usb_pcwd; |
724 | 725 | ||
725 | /* prevent races with open() */ | 726 | /* prevent races with open() */ |
726 | down (&disconnect_sem); | 727 | mutex_lock(&disconnect_mutex); |
727 | 728 | ||
728 | usb_pcwd = usb_get_intfdata (interface); | 729 | usb_pcwd = usb_get_intfdata (interface); |
729 | usb_set_intfdata (interface, NULL); | 730 | usb_set_intfdata (interface, NULL); |
@@ -749,7 +750,7 @@ static void usb_pcwd_disconnect(struct usb_interface *interface) | |||
749 | 750 | ||
750 | cards_found--; | 751 | cards_found--; |
751 | 752 | ||
752 | up (&disconnect_sem); | 753 | mutex_unlock(&disconnect_mutex); |
753 | 754 | ||
754 | printk(KERN_INFO PFX "USB PC Watchdog disconnected\n"); | 755 | printk(KERN_INFO PFX "USB PC Watchdog disconnected\n"); |
755 | } | 756 | } |