aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-04-02 21:53:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-02 21:53:43 -0400
commit6e8517a90b41b57d66926286c0add31145c75eb6 (patch)
tree86742bf65502870f360535c18ec919098e75bdf8
parentbd709bd027a394bce911a0cd60ee9cbdde49361b (diff)
parentaf8ee69df3b5cf4649d65efa3aa359c73c48402a (diff)
Merge tag 'regmap-v3.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap
Pull regmap fixes from Mark Brown: "A small collection of fixes. The most important ones are those from Stephen and Lars-Peter both of which fix cache issues that have been lurking for a while but not manifesting noticably enough for anyone to report them." * tag 'regmap-v3.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: async: Add missing return regmap: don't corrupt work buffer in _regmap_raw_write() regmap: cache Fix regcache-rbtree sync regmap: Initialize `map->debugfs' before regcache
-rw-r--r--drivers/base/regmap/regcache-rbtree.c2
-rw-r--r--drivers/base/regmap/regmap.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c
index e6732cf7c06e..79f4fca9877a 100644
--- a/drivers/base/regmap/regcache-rbtree.c
+++ b/drivers/base/regmap/regcache-rbtree.c
@@ -398,7 +398,7 @@ static int regcache_rbtree_sync(struct regmap *map, unsigned int min,
398 base = 0; 398 base = 0;
399 399
400 if (max < rbnode->base_reg + rbnode->blklen) 400 if (max < rbnode->base_reg + rbnode->blklen)
401 end = rbnode->base_reg + rbnode->blklen - max; 401 end = max - rbnode->base_reg + 1;
402 else 402 else
403 end = rbnode->blklen; 403 end = rbnode->blklen;
404 404
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,