[PATCH] mtd: nand: atmel: fix of_irq_get() error check

Wenyou.Yang at microchip.com Wenyou.Yang at microchip.com
Sun Aug 6 20:45:09 PDT 2017



> -----Original Message-----
> From: Sergei Shtylyov [mailto:sergei.shtylyov at cogentembedded.com]
> Sent: 2017年8月6日 5:14
> To: Wenyou Yang - A41535 <Wenyou.Yang at microchip.com>; Josh Wu
> <rainyfeeling at outlook.com>; Boris Brezillon <boris.brezillon at free-
> electrons.com>; Richard Weinberger <richard at nod.at>; David Woodhouse
> <dwmw2 at infradead.org>; Brian Norris <computersforpeace at gmail.com>; Marek
> Vasut <marek.vasut at gmail.com>; Cyrille Pitchen <cyrille.pitchen at wedev4u.fr>;
> linux-mtd at lists.infradead.org
> Cc: Sergei Shtylyov <sergei.shtylyov at cogentembedded.com>
> Subject: [PATCH] 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 iff
> of_irq_get() returned 0.
> 
> Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov at cogentembedded.com>
> 

Indeed.

Acked-by: Wenyou Yang <Wenyou.yang at microchip.com>


Best Regards,
Wenyou Yang


More information about the linux-mtd mailing list