Skip to content

Commit c29cc4a

Browse files
Yi Yangmiquelraynal
authored andcommitted
mtd: rawnand: omap2: Fix check 0 for platform_get_irq()
Refer to commit a85a6c8 ("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 <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 0a1166c commit c29cc4a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/mtd/nand/raw/omap2.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,8 +1881,8 @@ static int omap_nand_attach_chip(struct nand_chip *chip)
18811881

18821882
case NAND_OMAP_PREFETCH_IRQ:
18831883
info->gpmc_irq_fifo = platform_get_irq(info->pdev, 0);
1884-
if (info->gpmc_irq_fifo <= 0)
1885-
return -ENODEV;
1884+
if (info->gpmc_irq_fifo < 0)
1885+
return info->gpmc_irq_fifo;
18861886
err = devm_request_irq(dev, info->gpmc_irq_fifo,
18871887
omap_nand_irq, IRQF_SHARED,
18881888
"gpmc-nand-fifo", info);
@@ -1894,8 +1894,8 @@ static int omap_nand_attach_chip(struct nand_chip *chip)
18941894
}
18951895

18961896
info->gpmc_irq_count = platform_get_irq(info->pdev, 1);
1897-
if (info->gpmc_irq_count <= 0)
1898-
return -ENODEV;
1897+
if (info->gpmc_irq_count < 0)
1898+
return info->gpmc_irq_count;
18991899
err = devm_request_irq(dev, info->gpmc_irq_count,
19001900
omap_nand_irq, IRQF_SHARED,
19011901
"gpmc-nand-count", info);

0 commit comments

Comments
 (0)