* [PATCH] mtd: rawnand: omap2: Fix check 0 for platform_get_irq()
@ 2023-08-21 8:46 Yi Yang
2023-09-11 16:00 ` Miquel Raynal
0 siblings, 1 reply; 2+ messages in thread
From: Yi Yang @ 2023-08-21 8:46 UTC (permalink / raw)
To: miquel.raynal, richard, vigneshr
Cc: martin.blumenstingl, heiko, jernej.skrabec, nicolas.ferre, linux-mtd
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>
---
drivers/mtd/nand/raw/omap2.c | 8 ++++----
1 file 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);
--
2.17.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mtd: rawnand: omap2: Fix check 0 for platform_get_irq()
2023-08-21 8:46 [PATCH] mtd: rawnand: omap2: Fix check 0 for platform_get_irq() Yi Yang
@ 2023-09-11 16:00 ` Miquel Raynal
0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2023-09-11 16:00 UTC (permalink / raw)
To: Yi Yang, miquel.raynal, richard, vigneshr
Cc: martin.blumenstingl, heiko, jernej.skrabec, nicolas.ferre, linux-mtd
On Mon, 2023-08-21 at 08:46:22 UTC, Yi Yang wrote:
> 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>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.
Miquel
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-11 16:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-21 8:46 [PATCH] mtd: rawnand: omap2: Fix check 0 for platform_get_irq() Yi Yang
2023-09-11 16:00 ` Miquel Raynal
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.