]> git.baikalelectronics.ru Git - kernel.git/commit
iio: ltr501: Fix proximity threshold boundary check
authorKuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Fri, 15 May 2015 23:42:56 +0000 (16:42 -0700)
committerJonathan Cameron <jic23@kernel.org>
Sat, 16 May 2015 10:09:06 +0000 (11:09 +0100)
commit269192a475623cf6a2ffcfe2725e319638fb25de
tree8b19dd81de50b941d5f79a168625b373333fe0d6
parent937944b1495076fb80ae572f0232c39579ce7f46
iio: ltr501: Fix proximity threshold boundary check

Currently, proximity sensor boundary check is done
inside the switch block but outside the case
statement.Since this code will never get executed,
moved the check outside the switch case statement.

   867          case IIO_PROXIMITY:
   868                  switch (dir) {
   // Following line has been moved outside the switch block.
   869                  if (val > LTR501_PS_THRESH_MASK)
   870                          return -EINVAL;
   871                  case IIO_EV_DIR_RISING:

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/light/ltr501.c