aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-09-25 18:31:16 +0200
committerTakashi Iwai <tiwai@suse.de>2015-09-25 18:31:42 +0200
commit2d239afb51b7e622094b4bda0ccba214dbbd8d7c (patch)
tree441b944dbfa1940ebe8a96d91c7e8d3e0d0504f7
parent91fbf931d57559f995370d116fcebdbb037465ed (diff)
downloadhda-emu-2d239afb51b7e622094b4bda0ccba214dbbd8d7c.tar.gz
Fix regmap_read() behavior in cache_only mode
Align with the original behavior, return -EBUSY if cache_only is set but no cache is available. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--lib/hdac_regmap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/hdac_regmap.c b/lib/hdac_regmap.c
index b3d71b6..3f02f7c 100644
--- a/lib/hdac_regmap.c
+++ b/lib/hdac_regmap.c
@@ -121,6 +121,8 @@ int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val)
return -EINVAL;
if (!map->cache_bypass && cache_read_reg(map, reg, val))
return 0;
+ if (map->cache_only)
+ return -EBUSY;
err = map->config->reg_read(map->bus_context, reg, val);
if (!err && !map->cache_bypass &&
!map->config->volatile_reg(map->dev, reg))