Skip to content
Commit b2c7f5d9 authored by Maarten ter Huurne's avatar Maarten ter Huurne Committed by Mark Brown
Browse files

regmap: cache: Fix num_reg_defaults computation from reg_defaults_raw



In 3245d460 (regmap: cache: Fall back to register by register read for
cache defaults) non-readable registers are skipped when initializing
reg_defaults, but are still included in num_reg_defaults. So there can
be uninitialized entries at the end of reg_defaults, which can cause
problems when the register cache initializes from the full array.

Fixed it by excluding non-readable registers from the count as well.

Signed-off-by: default avatarMaarten ter Huurne <maarten@treewalker.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent efeb1a3a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment