Re: [PATCH v1 2/2] dmaengine: dw: implement per-channel protection control setting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 05, 2018 at 04:22:54PM +0200, Andy Shevchenko wrote:
> On Sun, Nov 04, 2018 at 06:01:39PM +0100, Christian Lamparter wrote:

> > +	struct dw_dma *dw = to_dw_dma(dwc->chan.device);
> > +	size_t chanidx = (size_t)(dwc - dw->chan);
> 
> We have mask field, so, index is a first set bit out of mask, __ffs(mask).
> 
> 	unsigned int protctl = dw->pdata->protctl[__ffs(mask)];

dwc->mask, of course.

Also, it's possible to use (though better to check) dwc->chan.chan_id, though I
dunno if it's reliable.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux