ti_adc108s102: fix verification off-by-one

Channel IDs start at 0, need to fail if the provided ID
equals ADC108S102_CHANNELS, not just larger than it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2018-05-07 11:19:24 -07:00 committed by Anas Nashif
commit 97ccf99b9b

View file

@ -138,7 +138,7 @@ static inline int _verify_entries(struct adc_seq_table *seq_table)
entry = &seq_table->entries[i];
if (entry->sampling_delay <= 0 ||
entry->channel_id > ADC108S102_CHANNELS) {
entry->channel_id >= ADC108S102_CHANNELS) {
return 0;
}