aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/watchdog/pcwd_usb.c
diff options
context:
space:
mode:
authorMatthias Kaehlcke <matthias.kaehlcke@gmail.com>2007-05-03 23:15:14 -0400
committerWim Van Sebroeck <wim@iguana.be>2007-05-04 02:07:59 -0400
commit9f7afa6b3405a2ceb9403153357564a93f14cde8 (patch)
tree607e01a9ad45d10bc4345f2f41a0d836bebd38f7 /drivers/char/watchdog/pcwd_usb.c
parentdbf379ea9ae878bf88d2b3cf8f74ce4536e25d19 (diff)
[WATCHDOG] use mutex instead of semaphore in Berkshire USB-PC Watchdog driver
The Berkshire USB-PC Watchdog driver uses a semaphore as mutex. Use the mutex API instead of the (binary) semaphore. Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'drivers/char/watchdog/pcwd_usb.c')
-rw-r--r--drivers/char/watchdog/pcwd_usb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/char/watchdog/pcwd_usb.c b/drivers/char/watchdog/pcwd_usb.c
index 31037f9c9ffe..1e7a6719d5ba 100644
--- a/drivers/char/watchdog/pcwd_usb.c
+++ b/drivers/char/watchdog/pcwd_usb.c
@@ -146,7 +146,7 @@ struct usb_pcwd_private {
146 atomic_t cmd_received; /* true if we received a report after a command */ 146 atomic_t cmd_received; /* true if we received a report after a command */
147 147
148 int exists; /* Wether or not the device exists */ 148 int exists; /* Wether or not the device exists */
149 struct semaphore sem; /* locks this structure */ 149 struct mutex mtx; /* locks this structure */
150}; 150};
151static struct usb_pcwd_private *usb_pcwd_device; 151static struct usb_pcwd_private *usb_pcwd_device;
152 152
@@ -635,7 +635,7 @@ static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_devi
635 635
636 usb_pcwd_device = usb_pcwd; 636 usb_pcwd_device = usb_pcwd;
637 637
638 init_MUTEX (&usb_pcwd->sem); 638 mutex_init(&usb_pcwd->mtx);
639 usb_pcwd->udev = udev; 639 usb_pcwd->udev = udev;
640 usb_pcwd->interface = interface; 640 usb_pcwd->interface = interface;
641 usb_pcwd->interface_number = iface_desc->desc.bInterfaceNumber; 641 usb_pcwd->interface_number = iface_desc->desc.bInterfaceNumber;
@@ -763,7 +763,7 @@ static void usb_pcwd_disconnect(struct usb_interface *interface)
763 usb_pcwd = usb_get_intfdata (interface); 763 usb_pcwd = usb_get_intfdata (interface);
764 usb_set_intfdata (interface, NULL); 764 usb_set_intfdata (interface, NULL);
765 765
766 down (&usb_pcwd->sem); 766 mutex_lock(&usb_pcwd->mtx);
767 767
768 /* Stop the timer before we leave */ 768 /* Stop the timer before we leave */
769 if (!nowayout) 769 if (!nowayout)
@@ -777,7 +777,7 @@ static void usb_pcwd_disconnect(struct usb_interface *interface)
777 misc_deregister(&usb_pcwd_temperature_miscdev); 777 misc_deregister(&usb_pcwd_temperature_miscdev);
778 unregister_reboot_notifier(&usb_pcwd_notifier); 778 unregister_reboot_notifier(&usb_pcwd_notifier);
779 779
780 up (&usb_pcwd->sem); 780 mutex_unlock(&usb_pcwd->mtx);
781 781
782 /* Delete the USB PCWD device */ 782 /* Delete the USB PCWD device */
783 usb_pcwd_delete(usb_pcwd); 783 usb_pcwd_delete(usb_pcwd);