Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Dan Carpenter and committed by
David S. Miller
28f961f9 924ee531

+6 -5
+3
drivers/dma/ti/k3-udma-glue.c
··· 1531 1531 flow->virq = k3_ringacc_get_ring_irq_num(flow->ringrx); 1532 1532 } 1533 1533 1534 + if (!flow->virq) 1535 + return -ENXIO; 1536 + 1534 1537 return flow->virq; 1535 1538 } 1536 1539 EXPORT_SYMBOL_GPL(k3_udma_glue_rx_get_irq);
+2 -2
drivers/net/ethernet/ti/am65-cpsw-nuss.c
··· 2424 2424 2425 2425 rx_chn->irq = k3_udma_glue_rx_get_irq(rx_chn->rx_chn, i); 2426 2426 2427 - if (rx_chn->irq <= 0) { 2427 + if (rx_chn->irq < 0) { 2428 2428 dev_err(dev, "Failed to get rx dma irq %d\n", 2429 2429 rx_chn->irq); 2430 - ret = -ENXIO; 2430 + ret = rx_chn->irq; 2431 2431 goto err; 2432 2432 } 2433 2433 }
+1 -3
drivers/net/ethernet/ti/icssg/icssg_common.c
··· 440 440 fdqring_id = k3_udma_glue_rx_flow_get_fdq_id(rx_chn->rx_chn, 441 441 i); 442 442 ret = k3_udma_glue_rx_get_irq(rx_chn->rx_chn, i); 443 - if (ret <= 0) { 444 - if (!ret) 445 - ret = -ENXIO; 443 + if (ret < 0) { 446 444 netdev_err(ndev, "Failed to get rx dma irq"); 447 445 goto fail; 448 446 }