]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: tegra210-adma: fix of_irq_get() error check
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Sun, 30 Jul 2017 18:10:44 +0000 (21:10 +0300)
committerVinod Koul <vinod.koul@intel.com>
Wed, 9 Aug 2017 06:09:16 +0000 (11:39 +0530)
commit57f65104d46b9c1a12bb8baee43d052e1b016156
tree6b9f7f6bdda6fd66e90d12d6f51701bde4ea9cba
parent9238ecfbaaeffcf7977c2776af9c57c0a4a878ed
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: a73c417c3cfa ("dmaengine: tegra-adma: Add support for Tegra210 ADMA")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/tegra210-adma.c