Skip to content

Commit e427e18

Browse files
andy-shevbroonie
authored andcommitted
regcache: Make ->exit() callback return void
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> Link: https://patch.msgid.link/20260618194036.3275202-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent dc59e4f commit e427e18

4 files changed

Lines changed: 7 additions & 13 deletions

File tree

drivers/base/regmap/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ struct regcache_ops {
189189
const char *name;
190190
enum regcache_type type;
191191
int (*init)(struct regmap *map);
192-
int (*exit)(struct regmap *map);
192+
void (*exit)(struct regmap *map);
193193
int (*populate)(struct regmap *map);
194194
#ifdef CONFIG_DEBUG_FS
195195
void (*debugfs_init)(struct regmap *map);

drivers/base/regmap/regcache-flat.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static int regcache_flat_init(struct regmap *map)
5353
return -ENOMEM;
5454
}
5555

56-
static int regcache_flat_exit(struct regmap *map)
56+
static void regcache_flat_exit(struct regmap *map)
5757
{
5858
struct regcache_flat_data *cache = map->cache;
5959

@@ -62,8 +62,6 @@ static int regcache_flat_exit(struct regmap *map)
6262

6363
kfree(cache);
6464
map->cache = NULL;
65-
66-
return 0;
6765
}
6866

6967
static int regcache_flat_populate(struct regmap *map)

drivers/base/regmap/regcache-maple.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,15 +307,15 @@ static int regcache_maple_init(struct regmap *map)
307307
return 0;
308308
}
309309

310-
static int regcache_maple_exit(struct regmap *map)
310+
static void regcache_maple_exit(struct regmap *map)
311311
{
312312
struct maple_tree *mt = map->cache;
313313
MA_STATE(mas, mt, 0, UINT_MAX);
314314
unsigned int *entry;
315315

316316
/* if we've already been called then just return */
317317
if (!mt)
318-
return 0;
318+
return;
319319

320320
mas_lock(&mas);
321321
mas_for_each(&mas, entry, UINT_MAX)
@@ -325,8 +325,6 @@ static int regcache_maple_exit(struct regmap *map)
325325

326326
kfree(mt);
327327
map->cache = NULL;
328-
329-
return 0;
330328
}
331329

332330
static int regcache_maple_insert_block(struct regmap *map, int first,

drivers/base/regmap/regcache-rbtree.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
static int regcache_rbtree_write(struct regmap *map, unsigned int reg,
1818
unsigned int value);
19-
static int regcache_rbtree_exit(struct regmap *map);
19+
static void regcache_rbtree_exit(struct regmap *map);
2020

2121
struct regcache_rbtree_node {
2222
/* block of adjacent registers */
@@ -196,7 +196,7 @@ static int regcache_rbtree_init(struct regmap *map)
196196
return 0;
197197
}
198198

199-
static int regcache_rbtree_exit(struct regmap *map)
199+
static void regcache_rbtree_exit(struct regmap *map)
200200
{
201201
struct rb_node *next;
202202
struct regcache_rbtree_ctx *rbtree_ctx;
@@ -205,7 +205,7 @@ static int regcache_rbtree_exit(struct regmap *map)
205205
/* if we've already been called then just return */
206206
rbtree_ctx = map->cache;
207207
if (!rbtree_ctx)
208-
return 0;
208+
return;
209209

210210
/* free up the rbtree */
211211
next = rb_first(&rbtree_ctx->root);
@@ -221,8 +221,6 @@ static int regcache_rbtree_exit(struct regmap *map)
221221
/* release the resources */
222222
kfree(map->cache);
223223
map->cache = NULL;
224-
225-
return 0;
226224
}
227225

228226
static int regcache_rbtree_populate(struct regmap *map)

0 commit comments

Comments
 (0)