From: Nikita Yushchenko <nyushche...@dev.rtsoft.ru>

This avoids leak of IRQ mapping on error paths, and makes it possible
to use devm_request_irq() without facing unmap-while-handler-installed
issues.

Signed-off-by: Nikita Yushchenko <nyushche...@dev.rtsoft.ru>
---
 drivers/mtd/nand/mpc5121_nfc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c
index e78841a..b710168 100644
--- a/drivers/mtd/nand/mpc5121_nfc.c
+++ b/drivers/mtd/nand/mpc5121_nfc.c
@@ -669,10 +669,10 @@ static int mpc5121_nfc_probe(struct platform_device *op)
                return retval;
        }
 
-       prv->irq = irq_of_parse_and_map(dn, 0);
-       if (prv->irq == NO_IRQ) {
+       prv->irq = devm_irq_of_parse_and_map(dev, dn, 0);
+       if (prv->irq <= 0) {
                dev_err(dev, "Error mapping IRQ!\n");
-               return -EINVAL;
+               return prv->irq ? prv->irq : -EINVAL;
        }
 
        retval = of_address_to_resource(dn, 0, &res);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to