Merge remote-tracking branch 'regmap/topic/core' into regmap-next

This commit is contained in:
Mark Brown 2018-01-12 20:03:55 +00:00
commit 86e41a2978
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -2423,13 +2423,15 @@ static int _regmap_bus_read(void *context, unsigned int reg,
{ {
int ret; int ret;
struct regmap *map = context; struct regmap *map = context;
void *work_val = map->work_buf + map->format.reg_bytes +
map->format.pad_bytes;
if (!map->format.parse_val) if (!map->format.parse_val)
return -EINVAL; return -EINVAL;
ret = _regmap_raw_read(map, reg, map->work_buf, map->format.val_bytes); ret = _regmap_raw_read(map, reg, work_val, map->format.val_bytes);
if (ret == 0) if (ret == 0)
*val = map->format.parse_val(map->work_buf); *val = map->format.parse_val(work_val);
return ret; return ret;
} }