On Wed, Mar 25, 2020 at 06:58:56AM +0000, Vaittinen, Matti wrote: > On Tue, 2020-03-24 at 14:24 +0000, Mark Brown wrote: > > On Tue, Mar 24, 2020 at 10:30:54AM +0200, Matti Vaittinen wrote: > > > > > > - if (!(min_uV <= linear_max_uV && max_uV >= range- > > > >min_uV)) > > > + ret = linear_range_get_selector_high(range, min_uV, > > > &sel, > > > + &found); > > > + if (ret) > > > continue; > > Why are these going for _get_selector_high()? Usually we try to > > choose > > the lowest voltage we can. > I tried to maintain the existing logic - which is (if I am not > mistaken) to search for first value which is equal or higher than the > minimum. Hence we use the linear_range_get_selector_high() - which does > not return selector for voltage smaller than given value (minimum). OK, that's a bit confusingly named then - I'd read that as finding the highest value within the range without registering that the function only takes a single value so can't verify if the selector is in range or not. I'll also need to check that the modified code verifies that the selector returned is within range.