]> git.baikalelectronics.ru Git - kernel.git/commit
regmap: Use bsearch() to search the register defaults
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 4 Oct 2011 21:05:47 +0000 (22:05 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 9 Oct 2011 11:36:56 +0000 (12:36 +0100)
commit10d809bf887c33bed103f6aef7986398aa2bf03a
tree6e6ff489fd8e445ff3b1e1a33e7488395d841e1b
parent34de1691dff0fa0795b732c72ef0c3cd24cab433
regmap: Use bsearch() to search the register defaults

Rather than open coding a binary search use the standard bsearch() using
the comparison function we're already using for sort() on insert. This
fixes a lockup I was observing due to iterating on min <= max rather
than min < max when we fail to look up.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
drivers/base/regmap/regcache.c