public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Georgios Tsotsos <tsotsos@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Georgios Tsotsos <tsotsos@gmail.com>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	James Hogan <jhogan@kernel.org>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH v5] Staging: octeon-usb: Changes macro CVMX_WAIT_FOR_FIELD32 to function call
Date: Mon, 30 Jul 2018 01:22:48 +0300	[thread overview]
Message-ID: <20180729222248.27180-1-tsotsos@gmail.com> (raw)
In-Reply-To: <20180729140522.32173-2-tsotsos@gmail.com>

Replacing CVMX_WAIT_FOR_FIELD32 macro with equivalent function, and used
simpler approach for new function's parameters.

Signed-off-by: Georgios Tsotsos <tsotsos@gmail.com>
---
v3: Changed CVMX_WAIT_FOR_FIELD32 macro to function according as refereed in
commit message and suggested by Greg Kroah-Hartman
v4: Added patch version text
v5: Fix parameters issue and simplify new function.

 drivers/staging/octeon-usb/octeon-hcd.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
index edf87d1b3609..c9fbff93bed4 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -574,18 +574,15 @@ static inline int cvmx_usb_get_data_pid(struct cvmx_usb_pipe *pipe)
  * Loop through register until txfflsh or rxfflsh become zero.
  *
  * @usb:           USB block
- * @address:       64bit address to read
- * @timeout_usec:  Timeout
  * @fflsh_type:    Indicates fflsh type, 0 for txfflsh, 1 for rxfflsh
  *
  */
-static int cvmx_wait_for_field32(struct octeon_hcd *usb, u64 address,
-				 u64 timeout_usec, int fflsh_type)
+static int cvmx_wait_tx_rx(struct octeon_hcd *usb, int fflsh_type)
 {
 	int result;
-	u64 done = cvmx_get_cycle() + timeout_usec *
+	u64 address = CVMX_USBCX_GRSTCTL(usb->index);
+	u64 done = cvmx_get_cycle() + 100 *
 		   (u64)octeon_get_clock_rate / 1000000;
-
 	union cvmx_usbcx_grstctl c;
 
 	while (1) {
@@ -648,9 +645,9 @@ static void cvmx_fifo_setup(struct octeon_hcd *usb)
 	/* Flush all FIFOs */
 	USB_SET_FIELD32(address, cvmx_usbcx_grstctl, txfnum, 0x10);
 	USB_SET_FIELD32(address, cvmx_usbcx_grstctl, txfflsh, 1);
-	cvmx_wait_for_field32(usb, address, 0, 100);
+	cvmx_wait_tx_rx(usb, 0);
 	USB_SET_FIELD32(address, cvmx_usbcx_grstctl, rxfflsh, 1);
-	cvmx_wait_for_field32(usb, address, 1, 100);
+	cvmx_wait_tx_rx(usb, 1);
 }
 
 /**
-- 
2.16.4

           reply	other threads:[~2018-07-29 22:31 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20180729140522.32173-2-tsotsos@gmail.com>]

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=20180729222248.27180-1-tsotsos@gmail.com \
    --to=tsotsos@gmail.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jhogan@kernel.org \
    --cc=linux-kernel@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