On Sun, Jul 29, 2018 at 02:41:53PM +0300, Georgios Tsotsos wrote:
> In order to make this function more clear a new function created that controls
> channels halt on no DMA mode.
> 
> Signed-off-by: Georgios Tsotsos <tsot...@gmail.com>
> ---
>  drivers/staging/octeon-usb/octeon-hcd.c | 81 
> +++++++++++++++++++++------------
>  1 file changed, 53 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/staging/octeon-usb/octeon-hcd.c 
> b/drivers/staging/octeon-usb/octeon-hcd.c
> index 8a7bdf1a9fe6..3f44ac260eff 100644
> --- a/drivers/staging/octeon-usb/octeon-hcd.c
> +++ b/drivers/staging/octeon-usb/octeon-hcd.c
> @@ -2593,7 +2593,51 @@ static void cvmx_usb_transfer_isoc(struct octeon_hcd 
> *usb,
>               cvmx_usb_complete(usb, pipe, transaction, CVMX_USB_STATUS_OK);
>       }
>  }
> +/**

Blank line between functions please.

Also, as this is not a global function, no need for kerneldoc
formatting, but you did it already, so no big deal.

> + * Handles channels halt in non DMA mode
> + * @hcchar_chena:
> + * @hcint_xfercompl:
> + * @usb:             USB device
> + * @channel:         Channel to poll
> + *
> + * In non DMA mode the channels don't halt themselves. We need
> + * to manually disable channels that are left running
> + *
> + * Returns: -1 on halt
> + */
> +static int cvmx_usb_dma_halt(u32 hcchar_chena, u32 hcint_xfercompl,
> +                          struct octeon_hcd *usb, int channel)
> +{
> +     struct usb_hcd *hcd = octeon_to_hcd(usb);
> +     struct device *dev = hcd->self.controller;
>  
> +     if (hcchar_chena) {
> +             union cvmx_usbcx_hcintmskx hcintmsk;
> +             union cvmx_usbcx_hccharx usbc_hcchar;
> +             /* Disable all interrupts except CHHLTD */
> +             hcintmsk.u32 = 0;
> +             hcintmsk.s.chhltdmsk = 1;
> +             cvmx_usb_write_csr32(usb,
> +                                  CVMX_USBCX_HCINTMSKX(channel, usb->index),
> +                                  hcintmsk.u32);
> +             usbc_hcchar.s.chdis = 1;
> +             cvmx_usb_write_csr32(usb,
> +                                  CVMX_USBCX_HCCHARX(channel, usb->index),
> +                                  usbc_hcchar.u32);
> +             return -1;

Do not make up error values, return -EINVAL or something like that (what
ever the real error here is.)

> +     } else if (hcint_xfercompl) {
> +             /*
> +              * Successful IN/OUT with transfer complete.
> +              * Channel halt isn't needed.
> +              */
> +     } else {
> +             dev_err(dev, "USB%d: Channel %d interrupt without halt\n",
> +                     usb->index, channel);
> +             return -1;

Same here.

thanks,

greg k-h
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to