diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-10-16 21:45:00 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-10-17 23:11:45 +0100 |
commit | 2918ad14cc7e16f38206185dbc65f980ffc4ec6c (patch) | |
tree | 72761082944e06b32e2f84fad3c0379f464c7f02 /drivers/iio | |
parent | bf741c08af194ed0448799ff2690c8dd3da709e5 (diff) | |
download | lwn-2918ad14cc7e16f38206185dbc65f980ffc4ec6c.tar.gz lwn-2918ad14cc7e16f38206185dbc65f980ffc4ec6c.zip |
staging:iio:lpc32xx_adc: Fix IRQ check
The test in the lpc32xx_adc driver which checks whether the IRQ number returned
by platform_get_irq() has multiple problems. It accepts 0 even though this is an
invalid IRQ. It also rejects IRQ numbers that are larger or equal than NR_IRQS.
First of all drivers should never need to reference NR_IRQS and secondly with
CONFIG_SPARSE_IRQ NR_IRQS is not the upper limit, so the check might reject
valid IRQ numbers. This patch modifies the check to only test against less or
equal to 0.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Roland Stigge <stigge@antcom.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
0 files changed, 0 insertions, 0 deletions