]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
regcache: Move HW readback after cache initialisation
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 5 Mar 2026 08:53:02 +0000 (09:53 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 5 Mar 2026 15:23:01 +0000 (15:23 +0000)
commite7662bced2e98ffa2c572126677deb9cf55d43b3
tree5cfe86a1fc64eb8bc5e280bb9fc88c45511a9eca
parent0cb7ae981894ff1fd0283813a17253250a747cf5
regcache: Move HW readback after cache initialisation

Make sure that cache is initialised before calling any IO
using regmap, this makes sure that we won't access NULL or
invalid pointers in the cache which hasn't been initialised.

As a side effect it also makes the ordering of cleaning up
the resources in regcache_exit() to be the same (and correct)
as in the error path of regcache_init(). This is not a problem
right now as they do not have dependencies, but it makes code
robust against potential changes in the future.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260305085449.3184020-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regcache.c