aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/adc
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2016-10-19 19:06:59 +0200
committerJonathan Cameron <jic23@kernel.org>2016-10-23 19:34:13 +0100
commitaa9602666894ca02935267c348286b4f1efda186 (patch)
treed5a2133acb80f379e995024b8b9c3fe8f0955a6c /drivers/staging/iio/adc
parentstaging:iio:ad7606: Remove default device configuration from platform data (diff)
downloadlinux-dev-aa9602666894ca02935267c348286b4f1efda186.tar.xz
linux-dev-aa9602666894ca02935267c348286b4f1efda186.zip
staging:iio:ad7606: Remove out-of-band error reporting
Currently the ad7606 driver prints a error message to the kernel log when an application writes an invalid value to a sysfs attribute. While for initial driver development and testing this might be useful it is quite disadvantageous in a production environment. The write() call to the sysfs attribute will already return an error if the value was invalid so the application is aware that the operation failed. And generally speaking it is impossible for an application to reliably match a log message in the kernel log to a specific operation it performed, so the message becomes just noise and might distract from more critical messages. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio/adc')
-rw-r--r--drivers/staging/iio/adc/ad7606_core.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/staging/iio/adc/ad7606_core.c b/drivers/staging/iio/adc/ad7606_core.c
index a16c6f5a333b..d3a35512261a 100644
--- a/drivers/staging/iio/adc/ad7606_core.c
+++ b/drivers/staging/iio/adc/ad7606_core.c
@@ -132,10 +132,9 @@ static ssize_t ad7606_store_range(struct device *dev,
if (ret)
return ret;
- if (!(lval == 5000 || lval == 10000)) {
- dev_err(dev, "range is not supported\n");
+ if (!(lval == 5000 || lval == 10000))
return -EINVAL;
- }
+
mutex_lock(&indio_dev->mlock);
gpio_set_value(st->pdata->gpio_range, lval == 10000);
st->range = lval;
@@ -174,11 +173,8 @@ static int ad7606_write_raw(struct iio_dev *indio_dev,
if (val2)
return -EINVAL;
ret = ad7606_oversampling_get_index(val);
- if (ret < 0) {
- dev_err(st->dev, "oversampling %d is not supported\n",
- val);
+ if (ret < 0)
return ret;
- }
mutex_lock(&indio_dev->mlock);
gpio_set_value(st->pdata->gpio_os0, (ret >> 0) & 1);