iio: hid-sensor: fix return of -EINVAL on invalid values in ret or value
authorColin Ian King <colin.king@canonical.com>
Wed, 19 Apr 2017 14:35:48 +0000 (15:35 +0100)
committerJonathan Cameron <jic23@kernel.org>
Thu, 27 Apr 2017 06:16:45 +0000 (07:16 +0100)
commitc894acc7bf400d039bf740420b22f0b71b7fb504
tree5a2e665773ec3f814211a5c3c8f82c273fc7ff92
parentc36662193b4e2e37e0e2084ca34585478526fa88
iio: hid-sensor: fix return of -EINVAL on invalid values in ret or value

Ensure that when an invalid value in ret or value is found -EINVAL
is returned. A previous commit broke the way the return error is
being returned and instead caused the return code in ret to be
re-assigned rather than be returned.

Fixes: 5d9854eaea776 ("iio: hid-sensor: Store restore poll and hysteresis on S3")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/common/hid-sensors/hid-sensor-attributes.c