On 20-07-21, 23:17, pandith.n@xxxxxxxxx wrote: > From: Pandith N <pandith.n@xxxxxxxxx> > > Removed free slot check algorithm in dw_axi_dma_set_hw_channel. For 8 > DMA channels, use respective handshake slot in DMA_HS_SEL APB register. > > For every channel, an dedicated slot is provided in hardware handshake > register AXIDMA_CTRL_DMA_HS_SEL_n. Peripheral source number is > programmed in respective channel slots. > > Signed-off-by: Pandith N <pandith.n@xxxxxxxxx> > Tested-by: Pan Kris <kris.pan@xxxxxxxxx> > --- > .../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 49 +++++++------------ > drivers/dma/dw-axi-dmac/dw-axi-dmac.h | 2 + > 2 files changed, 21 insertions(+), 30 deletions(-) > > diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c > index d9e4ac3edb4e..6b871e20ae27 100644 > --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c > +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c > @@ -470,19 +470,14 @@ static void dma_chan_free_chan_resources(struct dma_chan *dchan) > pm_runtime_put(chan->chip->dev); > } > > -static void dw_axi_dma_set_hw_channel(struct axi_dma_chip *chip, > - u32 handshake_num, bool set) > +static int dw_axi_dma_set_hw_channel(struct axi_dma_chan *chan, bool set) what is point of returning error if that is not checked and action taken in caller? > { > - unsigned long start = 0; > - unsigned long reg_value; > - unsigned long reg_mask; > - unsigned long reg_set; > - unsigned long mask; > - unsigned long val; > + struct axi_dma_chip *chip = chan->chip; > + unsigned long reg_value, val; > > if (!chip->apb_regs) { > dev_dbg(chip->dev, "apb_regs not initialized\n"); > - return; > + return -EINVAL; should the above log not be error now? -- ~Vinod