aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-23 15:48:40 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-23 15:57:11 -0500
commitc3ec23288a92e20e0aff84a4cb6fbc7cc9bcf567 (patch)
tree2bd8395c9e87fa9214ccd61c3b2a53b499727e3f /drivers/base
parent2a14d7d9b7439fe62082a60a7f8983ccb463d134 (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>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/regmap/regcache.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index ee36bed9479c..4d43ed363481 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -254,12 +254,11 @@ EXPORT_SYMBOL_GPL(regcache_write);
254int regcache_sync(struct regmap *map) 254int regcache_sync(struct regmap *map)
255{ 255{
256 int ret = 0; 256 int ret = 0;
257 unsigned int val;
258 unsigned int i; 257 unsigned int i;
259 const char *name; 258 const char *name;
260 unsigned int bypass; 259 unsigned int bypass;
261 260
262 BUG_ON(!map->cache_ops); 261 BUG_ON(!map->cache_ops || !map->cache_ops->sync);
263 262
264 mutex_lock(&map->lock); 263 mutex_lock(&map->lock);
265 /* Remember the initial bypass state */ 264 /* Remember the initial bypass state */
@@ -284,24 +283,8 @@ int regcache_sync(struct regmap *map)
284 } 283 }
285 map->cache_bypass = 0; 284 map->cache_bypass = 0;
286 285
287 if (map->cache_ops->sync) { 286 ret = map->cache_ops->sync(map);
288 ret = map->cache_ops->sync(map);
289 } else {
290 for (i = 0; i < map->num_reg_defaults; i++) {
291 ret = regcache_read(map, i, &val);
292 if (ret < 0)
293 goto out;
294 map->cache_bypass = 1;
295 ret = _regmap_write(map, i, val);
296 map->cache_bypass = 0;
297 if (ret < 0)
298 goto out;
299 dev_dbg(map->dev, "Synced register %#x, value %#x\n",
300 map->reg_defaults[i].reg,
301 map->reg_defaults[i].def);
302 }
303 287
304 }
305out: 288out:
306 trace_regcache_sync(map->dev, name, "stop"); 289 trace_regcache_sync(map->dev, name, "stop");
307 /* Restore the bypass state */ 290 /* Restore the bypass state */