Skip to contentSkip to conversation

staging: dgnc: replaced udelay with usleep_range in dgnc_cls.c

PATCH Superseded Juliana Rodrigues 2 participants 3 messages Mar 13, 2016 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: dgnc: replaced udelay with usleep_range in dgnc_cls.c

This patch replaces udelay with usleep_range fixing a checkpatch.pl issue:

CHECK: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt
+ udelay(10);

---
 drivers/staging/dgnc/dgnc_cls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/dgnc/dgnc_cls.c +1 -1
index 72f0aaa..51db98b 100644
@@ -956,7 +956,7 @@ static void cls_flush_uart_read(struct channel_t *ch)
 	 * Presumably, this is a bug in this UART.
 	 */
 
-	udelay(10);
+	usleep_range(10000, 11000);
 }
 
 static void cls_copy_data_from_queue_to_uart(struct channel_t *ch)
Signature · 1 line
2.7.2
maintainer
#1 lore raw
Quoted 15 lines · Juliana Rodrigues

This patch replaces udelay with usleep_range fixing a checkpatch.pl issue:

CHECK: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt
+ udelay(10);

---
 drivers/staging/dgnc/dgnc_cls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/dgnc/dgnc_cls.c +0 -0
index 72f0aaa..51db98b 100644

drivers/staging/dgnc/dgnc_cls.c static void cls_flush_uart_read(struct channel_t *ch) · line 959

Quoted 5 lines
drivers/staging/dgnc/dgnc_cls.c +1 -1
@@ -956,7 +956,7 @@ static void cls_flush_uart_read(struct channel_t *ch)
 	 * Presumably, this is a bug in this UART.
 	 */
 
-	udelay(10);
+	usleep_range(10000, 11000);

How do you know this range is ok?

#2 lore raw

Em Sáb, 2016-03-12 às 18:57 -0800, Greg KH escreveu:

Quoted 14 lines · Juliana Rodrigues
Quoted 13 lines

This patch replaces udelay with usleep_range fixing a checkpatch.pl issue:

CHECK: usleep_range is preferred over udelay; see
Documentation/timers/timers-howto.txt
+       udelay(10);

---
 drivers/staging/dgnc/dgnc_cls.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines

drivers/staging/dgnc/dgnc_cls.c static void cls_flush_uart_read(struct channel_t *ch) · line 959

Quoted 12 lines
drivers/staging/dgnc/dgnc_cls.c +0 -0
index 72f0aaa..51db98b 100644
@@ -956,7 +956,7 @@ static void cls_flush_uart_read(struct
 channel_t *ch)
  	 * Presumably, this is a bug in this UART.
  	 */

drivers/staging/dgnc/dgnc_cls.c +1 -1
-	udelay(10);
+	usleep_range(10000, 11000);

How do you know this range is ok?

Probably it isnt. I thought that usleep_range were in microseconds while udelay in miliseconds. I'll make a patch to fix this.

Thanks, Greg. :)

Quoted 1 line