Skip to content

Commit

Permalink
regmap: Remove default cache sync implementation
Browse files Browse the repository at this point in the history
It's not used as all cache types have sync operations so it's just dead
code which never gets tested.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Feb 23, 2012
1 parent 2a14d7d commit c3ec232
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions drivers/base/regmap/regcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,11 @@ EXPORT_SYMBOL_GPL(regcache_write);
int regcache_sync(struct regmap *map)
{
int ret = 0;
unsigned int val;
unsigned int i;
const char *name;
unsigned int bypass;

BUG_ON(!map->cache_ops);
BUG_ON(!map->cache_ops || !map->cache_ops->sync);

mutex_lock(&map->lock);
/* Remember the initial bypass state */
Expand All @@ -284,24 +283,8 @@ int regcache_sync(struct regmap *map)
}
map->cache_bypass = 0;

if (map->cache_ops->sync) {
ret = map->cache_ops->sync(map);
} else {
for (i = 0; i < map->num_reg_defaults; i++) {
ret = regcache_read(map, i, &val);
if (ret < 0)
goto out;
map->cache_bypass = 1;
ret = _regmap_write(map, i, val);
map->cache_bypass = 0;
if (ret < 0)
goto out;
dev_dbg(map->dev, "Synced register %#x, value %#x\n",
map->reg_defaults[i].reg,
map->reg_defaults[i].def);
}
ret = map->cache_ops->sync(map);

}
out:
trace_regcache_sync(map->dev, name, "stop");
/* Restore the bypass state */
Expand Down

0 comments on commit c3ec232

Please sign in to comment.