mtd: mxc_nand: Propagate the error if platform_get_irq() fails

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Apr 5 02:59:02 EDT 2014


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=26fbf48b7a04d585d89709d9e6f1e66b8bfc5dc2
Commit:     26fbf48b7a04d585d89709d9e6f1e66b8bfc5dc2
Parent:     da22b89386e8d4dc89525801dfe60f5f8c29668d
Author:     Fabio Estevam <fabio.estevam at freescale.com>
AuthorDate: Fri Feb 14 01:09:34 2014 -0200
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Mon Mar 10 22:42:26 2014 -0700

    mtd: mxc_nand: Propagate the error if platform_get_irq() fails
    
    Check the return value from platform_get_irq() and propagate it in the case of
    error.
    
    Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/mxc_nand.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index e9a4835..dba262b 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -1501,6 +1501,8 @@ static int mxcnd_probe(struct platform_device *pdev)
 	init_completion(&host->op_completion);
 
 	host->irq = platform_get_irq(pdev, 0);
+	if (host->irq < 0)
+		return host->irq;
 
 	/*
 	 * Use host->devtype_data->irq_control() here instead of irq_control()



More information about the linux-mtd-cvs mailing list