summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2018-02-12 18:15:44 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-30 08:17:44 +0200
commit27781e285b9a42f0cfed7aedaf17173d17048659 (patch)
tree2d60069c5261953d3dd28608af4e7a6d632123c9
parent7491974c5a5f65b6c986f5b65c091874fb35659d (diff)
downloadlinux-stable-27781e285b9a42f0cfed7aedaf17173d17048659.tar.gz
linux-stable-27781e285b9a42f0cfed7aedaf17173d17048659.tar.bz2
linux-stable-27781e285b9a42f0cfed7aedaf17173d17048659.zip
regmap: Correct comparison in regmap_cached
[ Upstream commit 71df179363a5a733a8932e9afb869760d7559383 ] The cache pointer points to the actual memory used by the cache, as the comparison here is looking for the type of the cache it should check against cache_type. Fixes: 1ea975cf1ef5 ("regmap: Add a function to check if a regmap register is cached") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/base/regmap/regmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 453116fd4362..c7b7c5fa73ab 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -99,7 +99,7 @@ bool regmap_cached(struct regmap *map, unsigned int reg)
int ret;
unsigned int val;
- if (map->cache == REGCACHE_NONE)
+ if (map->cache_type == REGCACHE_NONE)
return false;
if (!map->cache_ops)