]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
regcache: Allocate and free reg_defaults on the same level
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 5 Mar 2026 08:53:01 +0000 (09:53 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 5 Mar 2026 15:23:00 +0000 (15:23 +0000)
commit0cb7ae981894ff1fd0283813a17253250a747cf5
tree8ae9f71eadadc88c0484e4af75d9f5762893c0bc
parent8e2d279724944f788edc633e4888107eae666a37
regcache: Allocate and free reg_defaults on the same level

Currently reg_defaults buffer may be allocated on two different
levels when the user provided them and we duplicate it in regcache_init()
or when user wants us to read back from HW in regcache_hw_init().
This inconsistency makes code harder to follow and maintain. Allocate
and free reg_defaults on the same level in regcache_init() to improve
the readability and maintenance efforts.

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