drivers: imx: edma: avoid accessing register for non ready channels

avoid accessing registers for EDMA channels that are not
started to prevent crash

Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
Signed-off-by: Jerome Laclavere <jerome.laclavere@nxp.com>
This commit is contained in:
Guido Roncarolo 2019-10-16 16:57:08 +02:00 committed by Daniel Baluta
parent 6154b59e3b
commit 61b0b58865
1 changed files with 3 additions and 0 deletions

View File

@ -435,6 +435,9 @@ static int edma_remove(struct dma *dma)
static int edma_interrupt(struct dma_chan_data *channel, enum dma_irq_cmd cmd)
{
if (channel->status != COMP_STATE_INIT)
return 0;
switch (cmd) {
case DMA_IRQ_STATUS_GET:
return dma_chan_reg_read(channel, EDMA_CH_INT);