goto unlock;
/* Next the interrupt occurs */
- ret = wait_for_completion_timeout(&adc->complete,
- VADC_CONV_TIME_MAX_US);
- if (!ret) {
- dev_err(adc->dev, "conversion timed out\n");
+ if (!wait_for_completion_timeout(&adc->complete, VADC_CONV_TIME_MAX_US)) {
ret = -ETIMEDOUT;
goto unlock;
}
switch (mask) {
case IIO_CHAN_INFO_PROCESSED:
ch = pm8xxx_get_channel(adc, chan->address);
- if (!ch) {
- dev_err(adc->dev, "no such channel %lu\n",
- chan->address);
+ if (!ch)
return -EINVAL;
- }
ret = pm8xxx_read_channel(adc, ch, &adc_code);
if (ret)
return ret;
return IIO_VAL_INT;
case IIO_CHAN_INFO_RAW:
ch = pm8xxx_get_channel(adc, chan->address);
- if (!ch) {
- dev_err(adc->dev, "no such channel %lu\n",
- chan->address);
+ if (!ch)
return -EINVAL;
- }
ret = pm8xxx_read_channel(adc, ch, &adc_code);
if (ret)
return ret;