]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: sf-pdma: Get number of channel by device tree
authorZong Li <zong.li@sifive.com>
Mon, 28 Mar 2022 09:52:25 +0000 (17:52 +0800)
committerVinod Koul <vkoul@kernel.org>
Fri, 8 Apr 2022 13:13:29 +0000 (18:43 +0530)
commitf2ebdc8d66b928eba3889e40fab057df8d4f836a
tree12f3efdbca27a0f6b0af2de2b69b6b7e0491a244
parent9fcc9bac04c50a3db1d9b0ab7b433e637aaf90cc
dmaengine: sf-pdma: Get number of channel by device tree

It currently assumes that there are always four channels, it would
cause the error if there is actually less than four channels. Change
that by getting number of channel from device tree.

For backwards-compatibility, it uses the default value (i.e. 4) when
there is no 'dma-channels' information in dts.

Signed-off-by: Zong Li <zong.li@sifive.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Link: https://lore.kernel.org/r/f08a95b6582a51712c5b2c3cb859136d07bfa8b9.1648461096.git.zong.li@sifive.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/sf-pdma/sf-pdma.c
drivers/dma/sf-pdma/sf-pdma.h