Re: [PATCHv2 10/10] dw_dmac: introduce dwc_chan_reset

viresh kumar
2012-06-19T10:39:41Z

On Tue, Jun 19, 2012 at 11:34 AM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> This piece of code is used often. Make it as a separate function.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/dma/dw_dmac.c |   32 ++++++++++++++------------------
>  1 file changed, 14 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
> index d3845ef..14fbee4 100644
> --- a/drivers/dma/dw_dmac.c
> +++ b/drivers/dma/dw_dmac.c
> @@ -219,6 +219,14 @@ static void dwc_dump_chan_regs(struct dw_dma_chan *dwc)
>                channel_readl(dwc, CTL_LO));
>  }
>
> +
> +static inline void dwc_chan_reset(struct dw_dma *dw, struct dw_dma_chan *dwc)
> +{
> +       channel_clear_bit(dw, CH_EN, dwc->mask);
> +       while (dma_readl(dw, CH_EN) & dwc->mask)
> +               cpu_relax();
> +}

Hmm... This is not really a reset but disable.

Can you consider naming it more closer to what it is doing?

--
viresh