Skip to content

Commit

Permalink
staging: dgnc: replace udelay with usleep_range
Browse files Browse the repository at this point in the history
Fix checkpatch warning on dgnc_cls.c: CHECK usleep_range is preferred
over udelay. udelay(t) in function cls_uart_init is within non-atomic
context and can be safely replaced by usleep_range(t, t + delta) where
delta is t (as t is between 10 and 20 microseconds).

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Aishwarya Pant authored and Greg Kroah-Hartman committed Mar 6, 2017
1 parent 4bc58d1 commit 5e38c98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/dgnc/dgnc_cls.c
Original file line number Diff line number Diff line change
@@ -1096,7 +1096,7 @@ static void cls_uart_init(struct channel_t *ch)

writeb(UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT,
&ch->ch_cls_uart->isr_fcr);
udelay(10);
usleep_range(10, 20);

ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);

0 comments on commit 5e38c98

Please sign in to comment.