drivers: dma_mcux_edma: correct valid values for dma channel/slot
The dma-channels devicetree value - 1 = maximum valid channel The dma-requests devicetree value - 1 = maximum valid request Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
This commit is contained in:
parent
f5efa59fc3
commit
ad08d71efa
1 changed files with 3 additions and 3 deletions
|
@ -192,12 +192,12 @@ static int dma_mcux_edma_configure(const struct device *dev, uint32_t channel,
|
||||||
unsigned int key;
|
unsigned int key;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (slot > DT_INST_PROP(0, dma_requests)) {
|
if (slot >= DT_INST_PROP(0, dma_requests)) {
|
||||||
LOG_ERR("source number is outof scope %d", slot);
|
LOG_ERR("source number is out of scope %d", slot);
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (channel > DT_INST_PROP(0, dma_channels)) {
|
if (channel >= DT_INST_PROP(0, dma_channels)) {
|
||||||
LOG_ERR("out of DMA channel %d", channel);
|
LOG_ERR("out of DMA channel %d", channel);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue