mtd: nand: denali: return error code from devm_request_irq() on error
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 9 Nov 2016 04:35:27 +0000 (13:35 +0900)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Sat, 19 Nov 2016 08:40:08 +0000 (09:40 +0100)
The devm_request_irq() returns an appropriate error value when it
fails.  Use it instead of the fixed -ENODEV.

While we are here, reword the comment to make it fit in a single
line, fixing the misspelling of "initialization".

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/denali.c

index 5b34d4a6dfa47ac9978c6064b06ca74d41198923..f636ac4222d040265c67e7a30656e0af0f775c23 100644 (file)
@@ -1451,14 +1451,12 @@ int denali_init(struct denali_nand_info *denali)
        denali_hw_init(denali);
        denali_drv_init(denali);
 
-       /*
-        * denali_isr register is done after all the hardware
-        * initilization is finished
-        */
-       if (devm_request_irq(denali->dev, denali->irq, denali_isr, IRQF_SHARED,
-                            DENALI_NAND_NAME, denali)) {
+       /* Request IRQ after all the hardware initialization is finished */
+       ret = devm_request_irq(denali->dev, denali->irq, denali_isr,
+                              IRQF_SHARED, DENALI_NAND_NAME, denali);
+       if (ret) {
                dev_err(denali->dev, "Unable to request IRQ\n");
-               return -ENODEV;
+               return ret;
        }
 
        /* now that our ISR is registered, we can enable interrupts */