mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-01 10:33:27 +00:00
regmap: Try cached read before checking if a hardware read is possible
For some register format types we do not provide a parse_val so we can not do a hardware read. But a cached read is still possible, so try to read from the cache first, before checking whether a hardware read is possible. Otherwise the cache becomes pretty useless for these register types. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
720e4616e8
commit
19254411db
1 changed files with 3 additions and 3 deletions
|
@ -434,15 +434,15 @@ static int _regmap_read(struct regmap *map, unsigned int reg,
|
|||
{
|
||||
int ret;
|
||||
|
||||
if (!map->format.parse_val)
|
||||
return -EINVAL;
|
||||
|
||||
if (!map->cache_bypass) {
|
||||
ret = regcache_read(map, reg, val);
|
||||
if (ret == 0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!map->format.parse_val)
|
||||
return -EINVAL;
|
||||
|
||||
if (map->cache_only)
|
||||
return -EBUSY;
|
||||
|
||||
|
|
Loading…
Reference in a new issue