It is not possible for platform_get_irq() to return 0. Use the return value from platform_get_irq(). Signed-off-by: Ruan Jinjie <ruanjinjie@xxxxxxxxxx> --- drivers/dma/sa11x0-dma.c | 4 ++-- drivers/dma/xgene-dma.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/dma/sa11x0-dma.c b/drivers/dma/sa11x0-dma.c index a29c13cae716..53c7975f8aea 100644 --- a/drivers/dma/sa11x0-dma.c +++ b/drivers/dma/sa11x0-dma.c @@ -873,8 +873,8 @@ static int sa11x0_dma_request_irq(struct platform_device *pdev, int nr, { int irq = platform_get_irq(pdev, nr); - if (irq <= 0) - return -ENXIO; + if (irq < 0) + return irq; return request_irq(irq, sa11x0_dma_irq, 0, dev_name(&pdev->dev), data); } diff --git a/drivers/dma/xgene-dma.c b/drivers/dma/xgene-dma.c index bb4ff8c86733..a22a7cb2bb2c 100644 --- a/drivers/dma/xgene-dma.c +++ b/drivers/dma/xgene-dma.c @@ -1680,16 +1680,16 @@ static int xgene_dma_get_resources(struct platform_device *pdev, /* Get DMA error interrupt */ irq = platform_get_irq(pdev, 0); - if (irq <= 0) - return -ENXIO; + if (irq < 0) + return irq; pdma->err_irq = irq; /* Get DMA Rx ring descriptor interrupts for all DMA channels */ for (i = 1; i <= XGENE_DMA_MAX_CHANNEL; i++) { irq = platform_get_irq(pdev, i); - if (irq <= 0) - return -ENXIO; + if (irq < 0) + return irq; pdma->chan[i - 1].rx_irq = irq; } -- 2.34.1