Commit 6e8517a9 authored by Linus Torvalds's avatar Linus Torvalds

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
parents bd709bd0 af8ee69d
...@@ -398,7 +398,7 @@ static int regcache_rbtree_sync(struct regmap *map, unsigned int min, ...@@ -398,7 +398,7 @@ static int regcache_rbtree_sync(struct regmap *map, unsigned int min,
base = 0; base = 0;
if (max < rbnode->base_reg + rbnode->blklen) if (max < rbnode->base_reg + rbnode->blklen)
end = rbnode->base_reg + rbnode->blklen - max; end = max - rbnode->base_reg + 1;
else else
end = rbnode->blklen; end = rbnode->blklen;
......
...@@ -710,12 +710,12 @@ struct regmap *regmap_init(struct device *dev, ...@@ -710,12 +710,12 @@ struct regmap *regmap_init(struct device *dev,
} }
} }
regmap_debugfs_init(map, config->name);
ret = regcache_init(map, config); ret = regcache_init(map, config);
if (ret != 0) if (ret != 0)
goto err_range; goto err_range;
regmap_debugfs_init(map, config->name);
/* Add a devres resource for dev_get_regmap() */ /* Add a devres resource for dev_get_regmap() */
m = devres_alloc(dev_get_regmap_release, sizeof(*m), GFP_KERNEL); m = devres_alloc(dev_get_regmap_release, sizeof(*m), GFP_KERNEL);
if (!m) { if (!m) {
...@@ -943,8 +943,7 @@ static int _regmap_raw_write(struct regmap *map, unsigned int reg, ...@@ -943,8 +943,7 @@ static int _regmap_raw_write(struct regmap *map, unsigned int reg,
unsigned int ival; unsigned int ival;
int val_bytes = map->format.val_bytes; int val_bytes = map->format.val_bytes;
for (i = 0; i < val_len / val_bytes; i++) { for (i = 0; i < val_len / val_bytes; i++) {
memcpy(map->work_buf, val + (i * val_bytes), val_bytes); ival = map->format.parse_val(val + (i * val_bytes));
ival = map->format.parse_val(map->work_buf);
ret = regcache_write(map, reg + (i * map->reg_stride), ret = regcache_write(map, reg + (i * map->reg_stride),
ival); ival);
if (ret) { if (ret) {
...@@ -1036,6 +1035,8 @@ static int _regmap_raw_write(struct regmap *map, unsigned int reg, ...@@ -1036,6 +1035,8 @@ static int _regmap_raw_write(struct regmap *map, unsigned int reg,
kfree(async->work_buf); kfree(async->work_buf);
kfree(async); kfree(async);
} }
return ret;
} }
trace_regmap_hw_write_start(map->dev, reg, trace_regmap_hw_write_start(map->dev, reg,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment