Re: [PATCH v2 1/4] Input: ep93xx_keypad - Fix handling of platform_get_irq() error
From: Krzysztof Kozlowski <krzk@kernel.org>
Date: 2020-09-15 22:34:02
Also in:
linux-input, lkml
From: Krzysztof Kozlowski <krzk@kernel.org>
Date: 2020-09-15 22:34:02
Also in:
linux-input, lkml
On Mon, 14 Sep 2020 at 08:51, Dmitry Torokhov [off-list ref] wrote:
Hi Krzysztof, On Fri, Aug 28, 2020 at 04:57:41PM +0200, Krzysztof Kozlowski wrote:quoted
platform_get_irq() returns -ERRNO on error. In such case comparison to 0 would pass the check.platform_get_irq() is a bit of a mess. Historically we allowed defining interrupt resource with r->start == 0 and for such cases non-OF non-ACPI code will return 0 from platform_get_irq() to indicate that IRQ is not assigned. We either need to stop doing this in platform_get_irq(), or the conditions in this patch and followups should be "irq <= 0" and we need to make sure we do not accidentally return 0 from probe ...
Hi,
It's then contradictory to platform_get_irq documentation which
explicitly says - zero will not be returned on error. This was also
clarified in commit e330b9a6bb35 ("platform: don't return 0 from
platform_get_irq[_byname]() on error").
As I understood the input drivers code, they check for errors so the
coe in my patch is correct. Any "<=0" is not correct with current
documentation and implementation.
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel