Skip to content

Commit 8db4ec6

Browse files
manuelsdavem330
authored andcommitted
wan: Use usleep_range()
Instead of using a jiffies hack we can use the standard api for delays. Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f6d9b51 commit 8db4ec6

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

‎drivers/net/wan/farsync.c‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <linux/ioport.h>
2727
#include <linux/init.h>
2828
#include <linux/interrupt.h>
29+
#include <linux/delay.h>
2930
#include <linux/if.h>
3031
#include <linux/hdlc.h>
3132
#include <asm/io.h>
@@ -678,7 +679,6 @@ static inline void
678679
fst_cpureset(struct fst_card_info *card)
679680
{
680681
unsigned char interrupt_line_register;
681-
unsigned long j = jiffies + 1;
682682
unsigned int regval;
683683

684684
if (card->family == FST_FAMILY_TXU) {
@@ -696,16 +696,12 @@ fst_cpureset(struct fst_card_info *card)
696696
/*
697697
* We are delaying here to allow the 9054 to reset itself
698698
*/
699-
j = jiffies + 1;
700-
while (jiffies < j)
701-
/* Do nothing */ ;
699+
usleep_range(10, 20);
702700
outw(0x240f, card->pci_conf + CNTRL_9054 + 2);
703701
/*
704702
* We are delaying here to allow the 9054 to reload its eeprom
705703
*/
706-
j = jiffies + 1;
707-
while (jiffies < j)
708-
/* Do nothing */ ;
704+
usleep_range(10, 20);
709705
outw(0x040f, card->pci_conf + CNTRL_9054 + 2);
710706

711707
if (pci_write_config_byte

0 commit comments

Comments
 (0)