Skip to contentSkip to conversation

usb/cypress_m8: replace schedule_timeout() with

PATCH Applied Nishanth Aravamudan 2 participants 2 messages Jan 18, 2005 – Jan 20, 2005

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 21/21 usb/cypress_m8: replace schedule_timeout() with

Hi,

Please consider applying.

Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. The current code is not incorrect. Using msleep(), though, encourages specifying time delays in human time-units and consistency across the kernel.

drivers/usb/serial/cypress_m8.c +3 -3
@@ -49,9 +49,10 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/spinlock.h>
-#include <asm/uaccess.h>
 #include <linux/usb.h>
 #include <linux/serial.h>
+#include <linux/delay.h>
+#include <asm/uaccess.h>
 
 #ifdef CONFIG_USB_SERIAL_DEBUG
 	static int debug = 1;
@@ -916,8 +917,7 @@ static void cypress_set_termios (struct 
 	cypress_serial_control(port, baud_mask, data_bits, stop_bits, parity_enable,
 			       parity_type, 0, CYPRESS_SET_CONFIG);
 
-	set_current_state(TASK_INTERRUPTIBLE);
-	schedule_timeout(50*HZ/1000); /* give some time between change and read (50ms) */ 
+	msleep(50);			/* give some time between change and read (50ms) */
 
 	/* we perform a CYPRESS_GET_CONFIG so that the current settings are filled into the private structure
          * this should confirm that all is working if it returns what we just set */

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

Applied
#1 lore raw

Re: [KJ] [PATCH 21/21] usb/cypress_m8: replace schedule_timeout()

Quoted 10 lines · Nishanth Aravamudan

Hi,

Please consider applying.

Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. The current code is not incorrect. Using msleep(), though, encourages specifying time delays in human time-units and consistency across the kernel.

Applied, thanks.

greg k-h

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors