Commit aa960266 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Jonathan Cameron

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: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 9f72520f
...@@ -132,10 +132,9 @@ static ssize_t ad7606_store_range(struct device *dev, ...@@ -132,10 +132,9 @@ static ssize_t ad7606_store_range(struct device *dev,
if (ret) if (ret)
return ret; return ret;
if (!(lval == 5000 || lval == 10000)) { if (!(lval == 5000 || lval == 10000))
dev_err(dev, "range is not supported\n");
return -EINVAL; return -EINVAL;
}
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
gpio_set_value(st->pdata->gpio_range, lval == 10000); gpio_set_value(st->pdata->gpio_range, lval == 10000);
st->range = lval; st->range = lval;
...@@ -174,11 +173,8 @@ static int ad7606_write_raw(struct iio_dev *indio_dev, ...@@ -174,11 +173,8 @@ static int ad7606_write_raw(struct iio_dev *indio_dev,
if (val2) if (val2)
return -EINVAL; return -EINVAL;
ret = ad7606_oversampling_get_index(val); ret = ad7606_oversampling_get_index(val);
if (ret < 0) { if (ret < 0)
dev_err(st->dev, "oversampling %d is not supported\n",
val);
return ret; return ret;
}
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
gpio_set_value(st->pdata->gpio_os0, (ret >> 0) & 1); gpio_set_value(st->pdata->gpio_os0, (ret >> 0) & 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment