From fbba43c527d851088a891ed83346d5cc9f095b64 Mon Sep 17 00:00:00 2001
From: Xiubo Li
Date: Thu, 9 Oct 2014 17:02:55 +0800
Subject: [PATCH] regmap: cache: speed regcache_hw_init() up.
This may speed regcache_hw_init() up for some cases that there
has volatile registers.
Signed-off-by: Xiubo Li
Signed-off-by: Mark Brown
---
drivers/base/regmap/regcache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 6bec659e35d9..0852c890b4b5 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -71,9 +71,9 @@ static int regcache_hw_init(struct regmap *map)
/* fill the reg_defaults */
map->num_reg_defaults = count;
for (i = 0, j = 0; i < map->num_reg_defaults_raw; i++) {
- val = regcache_get_val(map, map->reg_defaults_raw, i);
if (regmap_volatile(map, i * map->reg_stride))
continue;
+ val = regcache_get_val(map, map->reg_defaults_raw, i);
map->reg_defaults[j].reg = i * map->reg_stride;
map->reg_defaults[j].def = val;
j++;
--
GitLab