From 555a1bd78bbc234342a8f3324a2487a56a118749 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Thu, 24 Sep 2026 14:30:54 +0800 Subject: [PATCH] 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 Link: https://patch.msgid.link/20260924-regmap-lock-guard-v3-3-8a6127223c16@nxp.com Signed-off-by: Mark Brown --- drivers/base/regmap/regcache-rbtree.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c index 520d5f8ba3cd..e2feed6dbecf 100644 --- a/drivers/base/regmap/regcache-rbtree.c +++ b/drivers/base/regmap/regcache-rbtree.c @@ -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; }