mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 06:00:43 +00:00
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:
parent
cd424f35ee
commit
e4f907e968
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue