* [PATCH v1 1/1] regcache: Make ->exit() callback return void
@ 2026-06-18 19:39 Andy Shevchenko
2026-06-29 13:18 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2026-06-18 19:39 UTC (permalink / raw)
To: Mark Brown, Andy Shevchenko, Sander Vanheule, linux-kernel,
driver-core
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
We do not check an error code from ->exit() callback, nor we ever
return one (it's always 0, meaning success). Make ->exit() callback
return void.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
This depends on recently accepted fix that dropped the returned value checks
for ->exit() callback.
drivers/base/regmap/internal.h | 2 +-
drivers/base/regmap/regcache-flat.c | 4 +---
drivers/base/regmap/regcache-maple.c | 6 ++----
drivers/base/regmap/regcache-rbtree.c | 8 +++-----
4 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h
index 55273a6178f8..a6e4689000af 100644
--- a/drivers/base/regmap/internal.h
+++ b/drivers/base/regmap/internal.h
@@ -189,7 +189,7 @@ struct regcache_ops {
const char *name;
enum regcache_type type;
int (*init)(struct regmap *map);
- int (*exit)(struct regmap *map);
+ void (*exit)(struct regmap *map);
int (*populate)(struct regmap *map);
#ifdef CONFIG_DEBUG_FS
void (*debugfs_init)(struct regmap *map);
diff --git a/drivers/base/regmap/regcache-flat.c b/drivers/base/regmap/regcache-flat.c
index 025e6749bb24..be8497fd240c 100644
--- a/drivers/base/regmap/regcache-flat.c
+++ b/drivers/base/regmap/regcache-flat.c
@@ -53,7 +53,7 @@ static int regcache_flat_init(struct regmap *map)
return -ENOMEM;
}
-static int regcache_flat_exit(struct regmap *map)
+static void regcache_flat_exit(struct regmap *map)
{
struct regcache_flat_data *cache = map->cache;
@@ -62,8 +62,6 @@ static int regcache_flat_exit(struct regmap *map)
kfree(cache);
map->cache = NULL;
-
- return 0;
}
static int regcache_flat_populate(struct regmap *map)
diff --git a/drivers/base/regmap/regcache-maple.c b/drivers/base/regmap/regcache-maple.c
index 49ba7282e4b8..9d2f3a23ffb2 100644
--- a/drivers/base/regmap/regcache-maple.c
+++ b/drivers/base/regmap/regcache-maple.c
@@ -307,7 +307,7 @@ static int regcache_maple_init(struct regmap *map)
return 0;
}
-static int regcache_maple_exit(struct regmap *map)
+static void regcache_maple_exit(struct regmap *map)
{
struct maple_tree *mt = map->cache;
MA_STATE(mas, mt, 0, UINT_MAX);
@@ -315,7 +315,7 @@ static int regcache_maple_exit(struct regmap *map)
/* if we've already been called then just return */
if (!mt)
- return 0;
+ return;
mas_lock(&mas);
mas_for_each(&mas, entry, UINT_MAX)
@@ -325,8 +325,6 @@ static int regcache_maple_exit(struct regmap *map)
kfree(mt);
map->cache = NULL;
-
- return 0;
}
static int regcache_maple_insert_block(struct regmap *map, int first,
diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c
index a69e8b4c359b..520d5f8ba3cd 100644
--- a/drivers/base/regmap/regcache-rbtree.c
+++ b/drivers/base/regmap/regcache-rbtree.c
@@ -16,7 +16,7 @@
static int regcache_rbtree_write(struct regmap *map, unsigned int reg,
unsigned int value);
-static int regcache_rbtree_exit(struct regmap *map);
+static void regcache_rbtree_exit(struct regmap *map);
struct regcache_rbtree_node {
/* block of adjacent registers */
@@ -196,7 +196,7 @@ static int regcache_rbtree_init(struct regmap *map)
return 0;
}
-static int regcache_rbtree_exit(struct regmap *map)
+static void regcache_rbtree_exit(struct regmap *map)
{
struct rb_node *next;
struct regcache_rbtree_ctx *rbtree_ctx;
@@ -205,7 +205,7 @@ static int regcache_rbtree_exit(struct regmap *map)
/* if we've already been called then just return */
rbtree_ctx = map->cache;
if (!rbtree_ctx)
- return 0;
+ return;
/* free up the rbtree */
next = rb_first(&rbtree_ctx->root);
@@ -221,8 +221,6 @@ static int regcache_rbtree_exit(struct regmap *map)
/* release the resources */
kfree(map->cache);
map->cache = NULL;
-
- return 0;
}
static int regcache_rbtree_populate(struct regmap *map)
--
2.50.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v1 1/1] regcache: Make ->exit() callback return void
2026-06-18 19:39 [PATCH v1 1/1] regcache: Make ->exit() callback return void Andy Shevchenko
@ 2026-06-29 13:18 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-06-29 13:18 UTC (permalink / raw)
To: Sander Vanheule, linux-kernel, driver-core, Andy Shevchenko
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich
On Thu, 18 Jun 2026 21:39:50 +0200, Andy Shevchenko wrote:
> regcache: Make ->exit() callback return void
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-7.3
Thanks!
[1/1] regcache: Make ->exit() callback return void
https://git.kernel.org/broonie/regmap/c/e427e1832bb0
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-30 11:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-18 19:39 [PATCH v1 1/1] regcache: Make ->exit() callback return void Andy Shevchenko
2026-06-29 13:18 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox