regmap: Optimize the lookup path to use binary search
authorDimitris Papastamos <dp@opensource.wolfsonmicro.com>
Mon, 3 Oct 2011 09:50:14 +0000 (10:50 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 3 Oct 2011 10:50:53 +0000 (11:50 +0100)
commitc08604b8ae72b4fa1843a76fc7b403ddec49f8f4
tree64de79de1019dbc3fd7862693a245bb29bf25e4b
parentac77a765cb6e3b5aa41c186ad9f37db7fdad7dbe
regmap: Optimize the lookup path to use binary search

Since there are more lookups than insertions in a typical
scenario, optimize the linear search into a binary search.  For
this to work, we need to keep reg_defaults sorted upon
insertions, for now be lazy and use sort().

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