staging: iio: ad5933: Return correct value for AD5933_OUT_RANGE.
authorPhil Turnbull <phil.turnbull@oracle.com>
Thu, 21 Jul 2016 15:23:13 +0000 (11:23 -0400)
committerJonathan Cameron <jic23@kernel.org>
Mon, 15 Aug 2016 14:39:04 +0000 (15:39 +0100)
commit776b645315d372e06e46167194605d308aa1a790
tree38f2b8164e92aa01a329af412e98176fb08d7804
parentbb9947c3a14e781eb0f137728e7e55ec8d848991
staging: iio: ad5933: Return correct value for AD5933_OUT_RANGE.

The 'break' statement after calling ad5933_cmd only breaks out of the
'for' loop, which then unconditionally sets the return value to -EINVAL.
Move the initialisation of 'ret' so we return the correct value.

Signed-off-by: Phil Turnbull <phil.turnbull@oracle.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/impedance-analyzer/ad5933.c