aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap/regcache.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2011-11-16 10:28:16 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-16 12:34:53 -0500
commite5e3b8abeda1cf45f5a079458dbc267952694c7a (patch)
tree46bd89885c027beaa4d549ea5f1d79f8a9279433 /drivers/base/regmap/regcache.c
parentc2b1ecd13c6a7b19f1c0c48b68f61ab083f3ec3f (diff)
regmap: Move initialization of regcache related fields to regcache_init
Move the initialization regcache related fields of the regmap struct to regcache_init. This allows us to keep regmap and regcache code better separated. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base/regmap/regcache.c')
-rw-r--r--drivers/base/regmap/regcache.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 27fae58ff4cb..0ad6cfb2c8cc 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -87,7 +87,7 @@ err_free:
87 return ret; 87 return ret;
88} 88}
89 89
90int regcache_init(struct regmap *map) 90int regcache_init(struct regmap *map, const struct regmap_config *config)
91{ 91{
92 int ret; 92 int ret;
93 int i; 93 int i;
@@ -108,6 +108,13 @@ int regcache_init(struct regmap *map)
108 return -EINVAL; 108 return -EINVAL;
109 } 109 }
110 110
111 map->reg_defaults = config->reg_defaults;
112 map->num_reg_defaults = config->num_reg_defaults;
113 map->num_reg_defaults_raw = config->num_reg_defaults_raw;
114 map->reg_defaults_raw = config->reg_defaults_raw;
115 map->cache_size_raw = (config->val_bits / 8) * config->num_reg_defaults_raw;
116 map->cache_word_size = config->val_bits / 8;
117
111 map->cache = NULL; 118 map->cache = NULL;
112 map->cache_ops = cache_types[i]; 119 map->cache_ops = cache_types[i];
113 120