drivers: adc: adc_mchp_xec: Add error logs

Adding error logs helps to find issue with incorrect mask and
channels.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2019-09-30 15:46:13 +03:00 committed by Maureen Helm
parent 2f6371c1ad
commit 582bb03296
1 changed files with 3 additions and 0 deletions

View File

@ -152,14 +152,17 @@ static int adc_xec_start_read(struct device *dev,
u32_t reg;
if (sequence->channels & ~BIT_MASK(MCHP_ADC_MAX_CHAN)) {
LOG_ERR("Incorrect channels, bitmask 0x%x", sequence->channels);
return -EINVAL;
}
if (sequence->channels == 0UL) {
LOG_ERR("No channel selected");
return -EINVAL;
}
if (!adc_xec_validate_buffer_size(sequence)) {
LOG_ERR("Incorrect buffer size");
return -ENOMEM;
}