Commit 7f577067 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Vinod Koul

dmaengine: tegra210-adma: fix of_irq_get() error check

of_irq_get() may return 0 as well as negative error number on failure,
while the driver only checks for the negative values. The driver would then
call request_irq(0, ...) in tegra_adma_alloc_chan_resources() and never get
valid channel interrupt.

Check for 'tdc->irq <= 0' instead and return -ENXIO from the driver's probe
iff of_irq_get() returned 0.

Fixes: f46b1957 ("dmaengine: tegra-adma: Add support for Tegra210 ADMA")
Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: default avatarThierry Reding <treding@nvidia.com>
Acked-by: default avatarJon Hunter <jonathanh@nvidia.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 5771a8c0
...@@ -717,8 +717,8 @@ static int tegra_adma_probe(struct platform_device *pdev) ...@@ -717,8 +717,8 @@ static int tegra_adma_probe(struct platform_device *pdev)
tdc->chan_addr = tdma->base_addr + ADMA_CH_REG_OFFSET(i); tdc->chan_addr = tdma->base_addr + ADMA_CH_REG_OFFSET(i);
tdc->irq = of_irq_get(pdev->dev.of_node, i); tdc->irq = of_irq_get(pdev->dev.of_node, i);
if (tdc->irq < 0) { if (tdc->irq <= 0) {
ret = tdc->irq; ret = tdc->irq ?: -ENXIO;
goto irq_dispose; goto irq_dispose;
} }
......
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