(I'm so sorry!) Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

regcache: use the regmap scoped lock guard

Convert the open-coded map->lock()/map->unlock() users in regcache.c to the regmap scoped guard introduced for regmap.c. Use scoped_guard(regmap, ...) in regcache_exit(), where the locked region is a subsection of the function, and guard(regmap)() for the function-scope critical sections. regcache_init() keeps explicit map->lock()/map->unlock() calls: it has a goto err_* cleanup ladder and mixing goto with cleanup helpers in the same function is not allowed by cleanup.h. regcache_sync() and regcache_sync_region() are left as-is: they already use a single goto out unlock path, so converting them would require either mixing a goto with a scoped_guard scope or restructuring their control flow, neither of which is an improvement. No functional change. Assisted-by: LLM Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://patch.msgid.link/20260924-regmap-lock-guard-v3-2-8a6127223c16@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>


Author Peng Fan Committer Mark Brown Date Commit Parent 80328b41
+8 -20
1 changed file
+8 -20
1 changed file