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

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

The k3_udma_glue_tx_get_irq() function currently returns negative error
codes on error, zero on error and positive values for success.  This
complicates life for the callers who need to propagate the error code.
Also GCC will not warn about unsigned comparisons when you check:

	if (unsigned_irq <= 0)

All the callers have been fixed now but let's just make this easy going
forward.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarRoger Quadros <rogerq@kernel.org>
Acked-by: default avatarVinod Koul <vkoul@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a325f174
...@@ -558,6 +558,9 @@ int k3_udma_glue_tx_get_irq(struct k3_udma_glue_tx_channel *tx_chn) ...@@ -558,6 +558,9 @@ int k3_udma_glue_tx_get_irq(struct k3_udma_glue_tx_channel *tx_chn)
tx_chn->virq = k3_ringacc_get_ring_irq_num(tx_chn->ringtxcq); tx_chn->virq = k3_ringacc_get_ring_irq_num(tx_chn->ringtxcq);
} }
if (!tx_chn->virq)
return -ENXIO;
return tx_chn->virq; return tx_chn->virq;
} }
EXPORT_SYMBOL_GPL(k3_udma_glue_tx_get_irq); EXPORT_SYMBOL_GPL(k3_udma_glue_tx_get_irq);
......
...@@ -1747,10 +1747,10 @@ static int am65_cpsw_nuss_init_tx_chns(struct am65_cpsw_common *common) ...@@ -1747,10 +1747,10 @@ static int am65_cpsw_nuss_init_tx_chns(struct am65_cpsw_common *common)
} }
tx_chn->irq = k3_udma_glue_tx_get_irq(tx_chn->tx_chn); tx_chn->irq = k3_udma_glue_tx_get_irq(tx_chn->tx_chn);
if (tx_chn->irq <= 0) { if (tx_chn->irq < 0) {
dev_err(dev, "Failed to get tx dma irq %d\n", dev_err(dev, "Failed to get tx dma irq %d\n",
tx_chn->irq); tx_chn->irq);
ret = tx_chn->irq ?: -ENXIO; ret = tx_chn->irq;
goto err; goto err;
} }
......
...@@ -317,9 +317,7 @@ static int prueth_init_tx_chns(struct prueth_emac *emac) ...@@ -317,9 +317,7 @@ static int prueth_init_tx_chns(struct prueth_emac *emac)
} }
ret = k3_udma_glue_tx_get_irq(tx_chn->tx_chn); ret = k3_udma_glue_tx_get_irq(tx_chn->tx_chn);
if (ret <= 0) { if (ret < 0) {
if (!ret)
ret = -EINVAL;
netdev_err(ndev, "failed to get tx irq\n"); netdev_err(ndev, "failed to get tx irq\n");
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