Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 892dd183 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Boris Brezillon
Browse files

mtd: nand: atmel: fix of_irq_get() error check



of_irq_get() may return 0 as well as negative error number on failure,
while the driver only checks for the negative values. The driver would
then call devm_request_irq() for IRQ0  in its probe method and never get
a valid interrupt.

Check for 'nc->irq <= 0' instead and return -ENXIO from the driver's probe
if of_irq_get() returned 0.

Fixes: f88fc122 ("mtd: nand: Cleanup/rework the atmel_nand driver")
Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: default avatarWenyou Yang <Wenyou.yang@microchip.com>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent fd213b5b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment