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)
commitf094fea68f0575286c55c06141cc89ffd0049024
tree6e6ff489fd8e445ff3b1e1a33e7488395d841e1b
parent0eef6b0415f58ed16aff95af8c92514ce5c01258
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