regcache: rbtree: use the regmap scoped lock guard

Convert the open-coded map->lock()/map->unlock() pair in rbtree_show()
to guard(regmap)(). The locked region spans the whole function body up
to the single return, so a function-scope guard drops the manual
unlock with 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-3-8a6127223c16@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Peng Fan 2026-09-24 14:30:54 +08:00 committed by Mark Brown
parent 23f1120dcb
commit 555a1bd78b
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -141,7 +141,7 @@ static int rbtree_show(struct seq_file *s, void *ignored)
int registers = 0;
int this_registers, average;
map->lock(map->lock_arg);
guard(regmap)(map);
mem_size = sizeof(*rbtree_ctx);
@ -168,8 +168,6 @@ static int rbtree_show(struct seq_file *s, void *ignored)
seq_printf(s, "%d nodes, %d registers, average %d registers, used %zu bytes\n",
nodes, registers, average, mem_size);
map->unlock(map->lock_arg);
return 0;
}