From: Xiubo Li
Date: Thu, 9 Oct 2014 09:02:53 +0000 (+0800)
Subject: regmap: cache: cleanup regcache_hw_init()
X-Git-Tag: v3.19-rc1~179^2~1^2~5
X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5bd83ed0984b0b0ac51d648b0ec167b36291f87e;p=karo-tx-linux.git
regmap: cache: cleanup regcache_hw_init()
Remove the redundant code for regmap cache.
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 f1280dc356d0..7558e6b01c04 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -57,12 +57,9 @@ static int regcache_hw_init(struct regmap *map)
}
/* calculate the size of reg_defaults */
- for (count = 0, i = 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;
- count++;
- }
+ for (count = 0, i = 0; i < map->num_reg_defaults_raw; i++)
+ if (!regmap_volatile(map, i * map->reg_stride))
+ count++;
map->reg_defaults = kmalloc(count * sizeof(struct reg_default),
GFP_KERNEL);