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:
parent
2f6371c1ad
commit
582bb03296
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue