]> git.baikalelectronics.ru Git - kernel.git/commit
regmap: Fix cache defaults initialization from raw cache defaults
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 15 Feb 2012 09:23:25 +0000 (10:23 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 15 Feb 2012 16:31:32 +0000 (08:31 -0800)
commita00b597302a3012fe16ac38631cc7227a49f181d
treef909dda9bab29b39cecbd67bc9af008a0cf1ec03
parentcc381c1506d2adfe03dd664d3d15899d18400db7
regmap: Fix cache defaults initialization from raw cache defaults

Currently registers with a value of 0 are ignored when initializing the register
defaults from raw defaults. This worked in the past, because registers without a
explicit default were assumed to have a default value of 0. This was changed in
commit 3376a934 ("regmap: Ensure rbtree syncs registers set to zero properly").
As a result registers, which have a raw default value of 0 are now assumed to
have no default. This again can result in unnecessary writes when syncing the
cache. It will also result in unnecessary reads for e.g. the first update
operation. In the case where readback is not possible this will even let the
update operation fail, if the register has not been written to before.

So this patch removes the check. Instead it adds a check to ignore raw defaults
for registers which are volatile, since those registers are not cached.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
drivers/base/regmap/regcache.c