From: Xiubo Li Date: Thu, 9 Oct 2014 09:02:55 +0000 (+0800) Subject: regmap: cache: speed regcache_hw_init() up. X-Git-Tag: v3.19-rc1~179^2~1^2~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=fbba43c527d851088a891ed83346d5cc9f095b64;p=karo-tx-linux.git 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 --- 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++;