aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap/regmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/regmap/regmap.c')
-rw-r--r--drivers/base/regmap/regmap.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 3d2367501fd0..d34adef1e63e 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -710,12 +710,12 @@ skip_format_initialization:
710 } 710 }
711 } 711 }
712 712
713 regmap_debugfs_init(map, config->name);
714
713 ret = regcache_init(map, config); 715 ret = regcache_init(map, config);
714 if (ret != 0) 716 if (ret != 0)
715 goto err_range; 717 goto err_range;
716 718
717 regmap_debugfs_init(map, config->name);
718
719 /* Add a devres resource for dev_get_regmap() */ 719 /* Add a devres resource for dev_get_regmap() */
720 m = devres_alloc(dev_get_regmap_release, sizeof(*m), GFP_KERNEL); 720 m = devres_alloc(dev_get_regmap_release, sizeof(*m), GFP_KERNEL);
721 if (!m) { 721 if (!m) {
@@ -943,8 +943,7 @@ static int _regmap_raw_write(struct regmap *map, unsigned int reg,
943 unsigned int ival; 943 unsigned int ival;
944 int val_bytes = map->format.val_bytes; 944 int val_bytes = map->format.val_bytes;
945 for (i = 0; i < val_len / val_bytes; i++) { 945 for (i = 0; i < val_len / val_bytes; i++) {
946 memcpy(map->work_buf, val + (i * val_bytes), val_bytes); 946 ival = map->format.parse_val(val + (i * val_bytes));
947 ival = map->format.parse_val(map->work_buf);
948 ret = regcache_write(map, reg + (i * map->reg_stride), 947 ret = regcache_write(map, reg + (i * map->reg_stride),
949 ival); 948 ival);
950 if (ret) { 949 if (ret) {
@@ -1036,6 +1035,8 @@ static int _regmap_raw_write(struct regmap *map, unsigned int reg,
1036 kfree(async->work_buf); 1035 kfree(async->work_buf);
1037 kfree(async); 1036 kfree(async);
1038 } 1037 }
1038
1039 return ret;
1039 } 1040 }
1040 1041
1041 trace_regmap_hw_write_start(map->dev, reg, 1042 trace_regmap_hw_write_start(map->dev, reg,