mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Manuel Schölling" <manuel.schoelling@gmx.de>
To: kevin.curtis@farsite.co.uk
Cc: davem@davemloft.net, joe@perches.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Manuel Schölling" <manuel.schoelling@gmx.de>
Subject: [PATCH] wan: Use usleep_range()
Date: Sat, 31 May 2014 17:07:51 +0200	[thread overview]
Message-ID: <1401548871-12352-1-git-send-email-manuel.schoelling@gmx.de> (raw)
In-Reply-To: <E603DC592C92B54A89CEF6B0919A0B1CAFDE223C6D@SOLO.hq.farsitecommunications.com>

Instead of using a jiffies hack we can use the standard api for delays.

Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de>
---
 drivers/net/wan/farsync.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index bcfff0d..02f6d1c 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -26,6 +26,7 @@
 #include <linux/ioport.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/delay.h>
 #include <linux/if.h>
 #include <linux/hdlc.h>
 #include <asm/io.h>
@@ -678,7 +679,6 @@ static inline void
 fst_cpureset(struct fst_card_info *card)
 {
 	unsigned char interrupt_line_register;
-	unsigned long j = jiffies + 1;
 	unsigned int regval;
 
 	if (card->family == FST_FAMILY_TXU) {
@@ -696,16 +696,12 @@ fst_cpureset(struct fst_card_info *card)
 		/*
 		 * We are delaying here to allow the 9054 to reset itself
 		 */
-		j = jiffies + 1;
-		while (jiffies < j)
-			/* Do nothing */ ;
+		usleep_range(10, 20);
 		outw(0x240f, card->pci_conf + CNTRL_9054 + 2);
 		/*
 		 * We are delaying here to allow the 9054 to reload its eeprom
 		 */
-		j = jiffies + 1;
-		while (jiffies < j)
-			/* Do nothing */ ;
+		usleep_range(10, 20);
 		outw(0x040f, card->pci_conf + CNTRL_9054 + 2);
 
 		if (pci_write_config_byte
-- 
1.7.10.4


  reply	other threads:[~2014-05-31 15:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-25 17:32 [PATCH] wan: time_before() Manuel Schölling
2014-05-25 17:58 ` Joe Perches
2014-05-26  4:40   ` David Miller
2014-05-28  7:09     ` Kevin Curtis
2014-05-31 15:07       ` Manuel Schölling [this message]
2014-06-02  8:56         ` [PATCH] wan: Use usleep_range() Kevin Curtis
2014-06-03  0:01         ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401548871-12352-1-git-send-email-manuel.schoelling@gmx.de \
    --to=manuel.schoelling@gmx.de \
    --cc=davem@davemloft.net \
    --cc=joe@perches.com \
    --cc=kevin.curtis@farsite.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®