From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mark Brown <broonie@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Sander Vanheule <sander@svanheule.net>,
linux-kernel@vger.kernel.org, driver-core@lists.linux.dev
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>
Subject: [PATCH v1 1/1] regcache: Make ->exit() callback return void
Date: Thu, 18 Jun 2026 21:39:50 +0200 [thread overview]
Message-ID: <20260618194036.3275202-1-andriy.shevchenko@linux.intel.com> (raw)
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
reply other threads:[~2026-06-18 19:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260618194036.3275202-1-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=broonie@kernel.org \
--cc=dakr@kernel.org \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=sander@svanheule.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox