Subject: Re: [PATCH v4 5/6] usb: musb: Add musb_clearb/w() interface

From: Bin Liu <[email-masked]>
Date: Mon, 21 Jan 2019 09:59:29 -0600

Hi Min,

On Mon, Jan 21, 2019 at 08:22:30PM +0800, [email-masked] wrote:
> From: Min Guo <[email-masked]>
> 
> Delete the const attribute of addr parameter in readb/w/l hooks, these
> changes are for implementing clearing W1C registers.
> Replace musb_readb/w with musb_clearb/w to clear the interrupt status.
> 
> Signed-off-by: Min Guo <[email-masked]>
> ---
> new patch based on v3:
> ---
>  drivers/usb/musb/musb_core.c | 32 +++++++++++++++++++++++---------
>  drivers/usb/musb/musb_core.h |  8 ++++++--
>  drivers/usb/musb/musb_io.h   |  8 +++++---
>  drivers/usb/musb/musbhsdma.c |  3 +++
>  drivers/usb/musb/sunxi.c     |  4 ++--
>  drivers/usb/musb/tusb6010.c  |  2 +-
>  6 files changed, 40 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> index 2fe5225..5ef8848 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c

[snip]

> diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c
> index b2394a7..7bf91cb 100644
> --- a/drivers/usb/musb/musbhsdma.c
> +++ b/drivers/usb/musb/musbhsdma.c
> @@ -286,6 +286,9 @@ irqreturn_t dma_controller_irq(int irq, void *private_data)
>  
>  	int_hsdma = musb_readb(mbase, MUSB_HSDMA_INTR);
>  
> +	/* clear pending interrupts by manual */
> +	musb_clearb(musb->mregs, MUSB_HSDMA_INTR);
> +

Make musb_clearb/w() return the value of the _read() instead of
_write(), so that we don't have to read twice here. The value of
_write() is not used anyway.

The change above can be:

	int_hsdma = musb_clearb(mbase, MUSB_HSDMA_INTR);

Please see my comments in 6/6 for details.

Regards,
-Bin.

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel