lkml.org 
[lkml]   [2018]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v5] Staging: octeon-usb: Changes macro CVMX_WAIT_FOR_FIELD32 to function call
Date
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
\
 
 \ /
  Last update: 2018-07-30 00:26    [W:0.027 / U:1.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site