summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorYi Yang <yiyang13@huawei.com>2023-08-21 10:46:22 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2023-09-11 17:49:56 +0200
commitc29cc4a95fa84c2c1dc8b1b990365a86a5458070 (patch)
tree2e03391bacb863d0261bd762c85f6e8f96eff247 /drivers/mtd
parentmtd: rawnand: tegra: add missing check for platform_get_irq() (diff)
downloadlinux-c29cc4a95fa84c2c1dc8b1b990365a86a5458070.tar.xz
linux-c29cc4a95fa84c2c1dc8b1b990365a86a5458070.zip
mtd: rawnand: omap2: Fix check 0 for platform_get_irq()
Refer to commit a85a6c86c25b ("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: Yi Yang <yiyang13@huawei.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230821084622.218442-1-yiyang13@huawei.com
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/raw/omap2.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/nand/raw/omap2.c b/drivers/mtd/nand/raw/omap2.c
index c45bef6158e7..cf76afc6c0ed 100644
--- a/drivers/mtd/nand/raw/omap2.c
+++ b/drivers/mtd/nand/raw/omap2.c
@@ -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);