aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/regmap/regcache.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 0ad6cfb2c8cc..d687df6ebdb0 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -108,7 +108,6 @@ int regcache_init(struct regmap *map, const struct regmap_config *config)
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; 111 map->num_reg_defaults = config->num_reg_defaults;
113 map->num_reg_defaults_raw = config->num_reg_defaults_raw; 112 map->num_reg_defaults_raw = config->num_reg_defaults_raw;
114 map->reg_defaults_raw = config->reg_defaults_raw; 113 map->reg_defaults_raw = config->reg_defaults_raw;
@@ -127,10 +126,10 @@ int regcache_init(struct regmap *map, const struct regmap_config *config)
127 * won't vanish from under us. We'll need to make 126 * won't vanish from under us. We'll need to make
128 * a copy of it. 127 * a copy of it.
129 */ 128 */
130 if (map->reg_defaults) { 129 if (config->reg_defaults) {
131 if (!map->num_reg_defaults) 130 if (!map->num_reg_defaults)
132 return -EINVAL; 131 return -EINVAL;
133 tmp_buf = kmemdup(map->reg_defaults, map->num_reg_defaults * 132 tmp_buf = kmemdup(config->reg_defaults, map->num_reg_defaults *
134 sizeof(struct reg_default), GFP_KERNEL); 133 sizeof(struct reg_default), GFP_KERNEL);
135 if (!tmp_buf) 134 if (!tmp_buf)
136 return -ENOMEM; 135 return -ENOMEM;