]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mtd: rawnand: stm32_fmc2: manage the get_irq error case
authorFabien Dessenne <fabien.dessenne@st.com>
Wed, 24 Apr 2019 14:49:06 +0000 (16:49 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 27 Jun 2019 18:05:23 +0000 (20:05 +0200)
During probe, check the "get_irq" error value.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Christophe Kerello <christophe.kerello@st.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/stm32_fmc2_nand.c

index 999ca6a66036c82cc277ea9733fff02d02ca27c5..4aabea25cd7d1956ca8a6358c0d0e42a817809a0 100644 (file)
@@ -1909,6 +1909,12 @@ static int stm32_fmc2_probe(struct platform_device *pdev)
        }
 
        irq = platform_get_irq(pdev, 0);
+       if (irq < 0) {
+               if (irq != -EPROBE_DEFER)
+                       dev_err(dev, "IRQ error missing or invalid\n");
+               return irq;
+       }
+
        ret = devm_request_irq(dev, irq, stm32_fmc2_irq, 0,
                               dev_name(dev), fmc2);
        if (ret) {