]> git.baikalelectronics.ru Git - kernel.git/commit
staging:iio:spear_adc: Fix IRQ check
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 16 Oct 2013 20:45:00 +0000 (21:45 +0100)
committerJonathan Cameron <jic23@kernel.org>
Thu, 17 Oct 2013 22:14:00 +0000 (23:14 +0100)
commit45e7b65d6781d4a5e069719dc806f2f5bf921576
treeb739df2d93216a29b69fb8ac34fd6baf5dca4145
parentcc33d4ff8984c7224366d6cbe5e6a4a8f07599fa
staging:iio:spear_adc: Fix IRQ check

The test in the spear_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: Stefan Roese <sr@denx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/adc/spear_adc.c