staging: octeon-usb: cvmx_usb_submit_bulk: get params from urb
Get the transfer parameters from urb. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0cce1004c1
commit
9ccca70718
|
@ -2402,34 +2402,20 @@ static int __cvmx_usb_submit_transaction(struct cvmx_usb_state *usb,
|
||||||
* @usb: USB device state populated by cvmx_usb_initialize().
|
* @usb: USB device state populated by cvmx_usb_initialize().
|
||||||
* @pipe_handle:
|
* @pipe_handle:
|
||||||
* Handle to the pipe for the transfer.
|
* Handle to the pipe for the transfer.
|
||||||
* @buffer: Physical address of the data buffer in
|
* @urb: URB.
|
||||||
* memory. Note that this is NOT A POINTER, but
|
|
||||||
* the full 64bit physical address of the
|
|
||||||
* buffer. This may be zero if buffer_length is
|
|
||||||
* zero.
|
|
||||||
* @buffer_length:
|
|
||||||
* Length of buffer in bytes.
|
|
||||||
* @urb: URB returned when the callback is called.
|
|
||||||
*
|
*
|
||||||
* Returns: A submitted transaction handle or negative on
|
* Returns: A submitted transaction handle or negative on
|
||||||
* failure. Negative values are error codes.
|
* failure. Negative values are error codes.
|
||||||
*/
|
*/
|
||||||
static int cvmx_usb_submit_bulk(struct cvmx_usb_state *usb, int pipe_handle,
|
static int cvmx_usb_submit_bulk(struct cvmx_usb_state *usb, int pipe_handle,
|
||||||
uint64_t buffer, int buffer_length,
|
|
||||||
struct urb *urb)
|
struct urb *urb)
|
||||||
{
|
{
|
||||||
int submit_handle;
|
int submit_handle;
|
||||||
|
|
||||||
/* Pipe handle checking is done later in a common place */
|
|
||||||
if (unlikely(!buffer))
|
|
||||||
return -EINVAL;
|
|
||||||
if (unlikely(buffer_length < 0))
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
submit_handle = __cvmx_usb_submit_transaction(usb, pipe_handle,
|
submit_handle = __cvmx_usb_submit_transaction(usb, pipe_handle,
|
||||||
CVMX_USB_TRANSFER_BULK,
|
CVMX_USB_TRANSFER_BULK,
|
||||||
buffer,
|
urb->transfer_dma,
|
||||||
buffer_length,
|
urb->transfer_buffer_length,
|
||||||
0, /* control_header */
|
0, /* control_header */
|
||||||
0, /* iso_start_frame */
|
0, /* iso_start_frame */
|
||||||
0, /* iso_number_packets */
|
0, /* iso_number_packets */
|
||||||
|
@ -3494,9 +3480,7 @@ static int octeon_usb_urb_enqueue(struct usb_hcd *hcd,
|
||||||
dev_dbg(dev, "Submit bulk to %d.%d\n",
|
dev_dbg(dev, "Submit bulk to %d.%d\n",
|
||||||
usb_pipedevice(urb->pipe), usb_pipeendpoint(urb->pipe));
|
usb_pipedevice(urb->pipe), usb_pipeendpoint(urb->pipe));
|
||||||
submit_handle = cvmx_usb_submit_bulk(&priv->usb, pipe_handle,
|
submit_handle = cvmx_usb_submit_bulk(&priv->usb, pipe_handle,
|
||||||
urb->transfer_dma,
|
urb);
|
||||||
urb->transfer_buffer_length,
|
|
||||||
urb);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (submit_handle < 0) {
|
if (submit_handle < 0) {
|
||||||
|
|
Loading…
Reference in New Issue