]> git.neil.brown.name Git - history.git/commitdiff
[Bluetooth] Replace schedule_timeout() with msleep()
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 28 Jul 2004 01:46:33 +0000 (03:46 +0200)
committerMarcel Holtmann <holtmann@holtmann.org>
Wed, 28 Jul 2004 01:46:33 +0000 (03:46 +0200)
Use msleep() instead of schedule_timeout() to guarantee the task
delays at least the desired time amount.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/bluecard_cs.c
drivers/bluetooth/bt3c_cs.c
drivers/bluetooth/btuart_cs.c
drivers/bluetooth/dtl1_cs.c

index 4e146b366845254cdd56ef1854a7251116ae37e6..54ef5f941eb971d365e1e50ca7815ea92283a66c 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/sched.h>
+#include <linux/delay.h>
 #include <linux/timer.h>
 #include <linux/errno.h>
 #include <linux/ptrace.h>
@@ -776,8 +777,7 @@ int bluecard_open(bluecard_info_t *info)
        outb(0x80, iobase + 0x30);
 
        /* Wait some time */
-       set_current_state(TASK_INTERRUPTIBLE);
-       schedule_timeout(HZ / 100);
+       msleep(10);
 
        /* Turn FPGA on */
        outb(0x00, iobase + 0x30);
@@ -823,8 +823,7 @@ int bluecard_open(bluecard_info_t *info)
        outb((0x0f << RTS_LEVEL_SHIFT_BITS) | 1, iobase + REG_RX_CONTROL);
 
        /* Timeout before it is safe to send the first HCI packet */
-       set_current_state(TASK_INTERRUPTIBLE);
-       schedule_timeout((HZ * 5) / 4);         // or set it to 3/2
+       msleep(1250);
 
        /* Register HCI device */
        if (hci_register_dev(hdev) < 0) {
index c7fccd3bfe467fa9430a18c6877a72255d4c64e6..d67d0385f20bdf2caddc7025be270ad6af618c86 100644 (file)
 #include <linux/module.h>
 
 #include <linux/kernel.h>
-#include <linux/kmod.h>
 #include <linux/init.h>
 #include <linux/slab.h>
-#include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/sched.h>
+#include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
@@ -639,8 +638,7 @@ int bt3c_open(bt3c_info_t *info)
        }
 
        /* Timeout before it is safe to send the first HCI packet */
-       set_current_state(TASK_INTERRUPTIBLE);
-       schedule_timeout(HZ);
+       msleep(1000);
 
        /* Register HCI device */
        err = hci_register_dev(hdev);
index a18be62b0387f28daf3b2c483e95704329b64927..b44fa7dd38c350b07f533a2d3b549e4af2eca9d3 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/sched.h>
+#include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
@@ -545,8 +546,7 @@ int btuart_open(btuart_info_t *info)
        btuart_change_speed(info, DEFAULT_BAUD_RATE);
 
        /* Timeout before it is safe to send the first HCI packet */
-       set_current_state(TASK_INTERRUPTIBLE);
-       schedule_timeout(HZ);
+       msleep(1000);
 
        /* Register HCI device */
        if (hci_register_dev(hdev) < 0) {
index f3b423b09760d12b940603f1acf74bc86d0f087d..79ec1ce7841d6aae503f169408f680974eae74e7 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/sched.h>
+#include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
@@ -524,8 +525,7 @@ int dtl1_open(dtl1_info_t *info)
        spin_unlock_irqrestore(&(info->lock), flags);
 
        /* Timeout before it is safe to send the first HCI packet */
-       set_current_state(TASK_INTERRUPTIBLE);
-       schedule_timeout(HZ * 2);
+       msleep(2000);
 
        /* Register HCI device */
        if (hci_register_dev(hdev) < 0) {