]> git.baikalelectronics.ru Git - kernel.git/commit
regmap: regcache: allow read-only regs to be cached
authorIonut Nicu <ioan.nicu.ext@nsn.com>
Fri, 9 Aug 2013 10:09:20 +0000 (12:09 +0200)
committerMark Brown <broonie@linaro.org>
Fri, 9 Aug 2013 11:47:29 +0000 (12:47 +0100)
commitcbfb273e8b6d85c0ac9f69ed7afabee5f26c1975
tree8d8a3264f62d32c91463f3ff392db15debb30262
parenta6259a217e450ae6e344cdc57145524d52203d34
regmap: regcache: allow read-only regs to be cached

The regmap_writeable() check should not be done in
regcache_write() because this prevents read-only
registers to be cached. After a read on a read-only
register its value will not be stored in the cache
and the next time someone will try to read it the
value will be read from the bus instead of the
cache.

Instead the regmap_writeable() check should be done
in _regmap_write() to prevent callers from writing
to read-only registers.

Signed-off-by: Ionut Nicu <ioan.nicu.ext@nsn.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/base/regmap/regcache.c
drivers/base/regmap/regmap.c