diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-02-23 20:48:40 +0000 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-04-15 13:33:44 -0700 |
commit | 01b30d0d2ab37eec4a5232e4fcf02716662830a3 (patch) | |
tree | 320d744f945a531093ee9d221c6adab7db8a44c6 /drivers/base/regmap/regcache.c | |
parent | a952b6c0998c96862418a6c0b6b63abe39d92497 (diff) |
regmap: Remove default cache sync implementation
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>
(cherry picked from commit c3ec23288a92e20e0aff84a4cb6fbc7cc9bcf567)
Change-Id: I3ba8c8afee9a7c945dc0a52e87c9f4a357e79308
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/96486
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'drivers/base/regmap/regcache.c')
-rw-r--r-- | drivers/base/regmap/regcache.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index 87bb299cdec9..156e2a56de44 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c @@ -256,12 +256,11 @@ int regcache_write(struct regmap *map, 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 */ @@ -286,24 +285,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 */ |