Commit c29cc4a9 authored by Yi Yang's avatar Yi Yang Committed by Miquel Raynal

mtd: rawnand: omap2: Fix check 0 for platform_get_irq()

Refer to commit a85a6c86 ("driver core: platform: Clarify that IRQ
0 is invalid"). Do not check 0 for platform_get_irq(), because
platform_get_irq() never return zero, and use the return error code of
platform_get_irq() instead of -ENODEV.
Signed-off-by: default avatarYi Yang <yiyang13@huawei.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20230821084622.218442-1-yiyang13@huawei.com
parent 0a1166c2
......@@ -1881,8 +1881,8 @@ static int omap_nand_attach_chip(struct nand_chip *chip)
case NAND_OMAP_PREFETCH_IRQ:
info->gpmc_irq_fifo = platform_get_irq(info->pdev, 0);
if (info->gpmc_irq_fifo <= 0)
return -ENODEV;
if (info->gpmc_irq_fifo < 0)
return info->gpmc_irq_fifo;
err = devm_request_irq(dev, info->gpmc_irq_fifo,
omap_nand_irq, IRQF_SHARED,
"gpmc-nand-fifo", info);
......@@ -1894,8 +1894,8 @@ static int omap_nand_attach_chip(struct nand_chip *chip)
}
info->gpmc_irq_count = platform_get_irq(info->pdev, 1);
if (info->gpmc_irq_count <= 0)
return -ENODEV;
if (info->gpmc_irq_count < 0)
return info->gpmc_irq_count;
err = devm_request_irq(dev, info->gpmc_irq_count,
omap_nand_irq, IRQF_SHARED,
"gpmc-nand-count", info);
......
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