]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
regmap: Correct comparison in regmap_cached
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Mon, 12 Feb 2018 18:15:44 +0000 (18:15 +0000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 27 Aug 2018 14:40:05 +0000 (16:40 +0200)
BugLink: http://bugs.launchpad.net/bugs/1786352
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/base/regmap/regmap.c

index dc7a10e9506ffdc31786b29e04ef59e07a1c8d97..9f6fe3fa00472e2ebebece529126dd03dd241761 100644 (file)
@@ -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)