Commit 28f961f9 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

dmaengine: ti: k3-udma-glue: clean up return in k3_udma_glue_rx_get_irq()

Currently the k3_udma_glue_rx_get_irq() function returns either negative
error codes or zero on error.  Generally, in the kernel, zero means
success so this be confusing and has caused bugs in the past.  Also the
"tx" version of this function only returns negative error codes.  Let's
clean this "rx" function so both functions match.

This patch has no effect on runtime.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Acked-by: default avatarPeter Ujfalusi <peter.ujfalusi@gmail.com>
Acked-by: default avatarVinod Koul <vkoul@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 924ee531
...@@ -1531,6 +1531,9 @@ int k3_udma_glue_rx_get_irq(struct k3_udma_glue_rx_channel *rx_chn, ...@@ -1531,6 +1531,9 @@ int k3_udma_glue_rx_get_irq(struct k3_udma_glue_rx_channel *rx_chn,
flow->virq = k3_ringacc_get_ring_irq_num(flow->ringrx); flow->virq = k3_ringacc_get_ring_irq_num(flow->ringrx);
} }
if (!flow->virq)
return -ENXIO;
return flow->virq; return flow->virq;
} }
EXPORT_SYMBOL_GPL(k3_udma_glue_rx_get_irq); EXPORT_SYMBOL_GPL(k3_udma_glue_rx_get_irq);
......
...@@ -2424,10 +2424,10 @@ static int am65_cpsw_nuss_init_rx_chns(struct am65_cpsw_common *common) ...@@ -2424,10 +2424,10 @@ static int am65_cpsw_nuss_init_rx_chns(struct am65_cpsw_common *common)
rx_chn->irq = k3_udma_glue_rx_get_irq(rx_chn->rx_chn, i); rx_chn->irq = k3_udma_glue_rx_get_irq(rx_chn->rx_chn, i);
if (rx_chn->irq <= 0) { if (rx_chn->irq < 0) {
dev_err(dev, "Failed to get rx dma irq %d\n", dev_err(dev, "Failed to get rx dma irq %d\n",
rx_chn->irq); rx_chn->irq);
ret = -ENXIO; ret = rx_chn->irq;
goto err; goto err;
} }
} }
......
...@@ -440,9 +440,7 @@ int prueth_init_rx_chns(struct prueth_emac *emac, ...@@ -440,9 +440,7 @@ int prueth_init_rx_chns(struct prueth_emac *emac,
fdqring_id = k3_udma_glue_rx_flow_get_fdq_id(rx_chn->rx_chn, fdqring_id = k3_udma_glue_rx_flow_get_fdq_id(rx_chn->rx_chn,
i); i);
ret = k3_udma_glue_rx_get_irq(rx_chn->rx_chn, i); ret = k3_udma_glue_rx_get_irq(rx_chn->rx_chn, i);
if (ret <= 0) { if (ret < 0) {
if (!ret)
ret = -ENXIO;
netdev_err(ndev, "Failed to get rx dma irq"); netdev_err(ndev, "Failed to get rx dma irq");
goto fail; goto fail;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment