dma: bcm6348: check if driver is enabled before send/recv

This patch prevents errors when running tftpput.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
Álvaro Fernández Rojas 2019-03-22 18:22:31 +01:00 committed by Daniel Schwierzeck
parent cd424f35ee
commit e4f907e968

View file

@ -324,6 +324,9 @@ static int bcm6348_iudma_receive(struct dma *dma, void **dst, void *metadata)
struct bcm6348_dma_desc *dma_desc = dma_desc = ch_priv->dma_ring;
int ret;
if (!ch_priv->running)
return -EINVAL;
/* get dma ring descriptor address */
dma_desc += ch_priv->desc_id;
@ -369,6 +372,9 @@ static int bcm6348_iudma_send(struct dma *dma, void *src, size_t len,
struct bcm6348_dma_desc *dma_desc;
uint16_t status;
if (!ch_priv->running)
return -EINVAL;
/* flush cache */
bcm6348_iudma_fdc(src, len);