From: Mark Brown Date: Mon, 12 Mar 2018 16:50:42 +0000 (-0700) Subject: Merge remote-tracking branches 'regmap/topic/debugfs' and 'regmap/topic/mmio-clk... X-Git-Tag: v4.17-rc1~158^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2889312616aecf1a1153be0fab19206a6b1f768f;p=thirdparty%2Fkernel%2Flinux.git Merge remote-tracking branches 'regmap/topic/debugfs' and 'regmap/topic/mmio-clk' into regmap-next --- 2889312616aecf1a1153be0fab19206a6b1f768f diff --cc drivers/base/regmap/regmap.c index 9d042ee8707d6,f5fa1ddc65e9b,ee302ccdfbc8d..3bc84885eb919 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@@@ -2514,32 -2548,14 -2546,14 +2516,32 @@@@ int regmap_raw_read(struct regmap *map ret = -ENOTSUPP; goto out; } -- if (map->max_raw_read && map->max_raw_read < val_len) { -- ret = -E2BIG; -- goto out; -- } -- /* Physical block read if there's no cache involved */ -- ret = _regmap_raw_read(map, reg, val, val_len); ++ if (map->use_single_read) ++ chunk_regs = 1; ++ else if (map->max_raw_read && val_len > map->max_raw_read) ++ chunk_regs = map->max_raw_read / val_bytes; ++ ++ chunk_count = val_count / chunk_regs; ++ chunk_bytes = chunk_regs * val_bytes; + ++ /* Read bytes that fit into whole chunks */ ++ for (i = 0; i < chunk_count; i++) { ++ ret = _regmap_raw_read(map, reg, val, chunk_bytes); ++ if (ret != 0) ++ goto out; ++ ++ reg += regmap_get_offset(map, chunk_regs); ++ val += chunk_bytes; ++ val_len -= chunk_bytes; ++ } + ++ /* Read remaining bytes */ ++ if (val_len) { ++ ret = _regmap_raw_read(map, reg, val, val_len); ++ if (ret != 0) ++ goto out; ++ } } else { /* Otherwise go word by word for the cache; should be low * cost as we expect to hit the cache.