Skip to content

Commit eb708cd

Browse files
rfvirgilbroonie
authored andcommitted
regmap: regmap_multi_reg_read(): make register list const
Mark the list of registers passed into regmap_multi_reg_read() as a pointer to const. This allows the caller to define the register list as const data. This requires making the same change to _regmap_bulk_read(), which is called by regmap_multi_reg_read(). Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20241211133558.884669-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 1331fb6 commit eb708cd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/base/regmap/regmap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3115,7 +3115,7 @@ int regmap_fields_read(struct regmap_field *field, unsigned int id,
31153115
EXPORT_SYMBOL_GPL(regmap_fields_read);
31163116

31173117
static int _regmap_bulk_read(struct regmap *map, unsigned int reg,
3118-
unsigned int *regs, void *val, size_t val_count)
3118+
const unsigned int *regs, void *val, size_t val_count)
31193119
{
31203120
u32 *u32 = val;
31213121
u16 *u16 = val;
@@ -3209,7 +3209,7 @@ EXPORT_SYMBOL_GPL(regmap_bulk_read);
32093209
* A value of zero will be returned on success, a negative errno will
32103210
* be returned in error cases.
32113211
*/
3212-
int regmap_multi_reg_read(struct regmap *map, unsigned int *regs, void *val,
3212+
int regmap_multi_reg_read(struct regmap *map, const unsigned int *regs, void *val,
32133213
size_t val_count)
32143214
{
32153215
if (val_count == 0)

include/linux/regmap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ int regmap_noinc_read(struct regmap *map, unsigned int reg,
12441244
void *val, size_t val_len);
12451245
int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
12461246
size_t val_count);
1247-
int regmap_multi_reg_read(struct regmap *map, unsigned int *reg, void *val,
1247+
int regmap_multi_reg_read(struct regmap *map, const unsigned int *reg, void *val,
12481248
size_t val_count);
12491249
int regmap_update_bits_base(struct regmap *map, unsigned int reg,
12501250
unsigned int mask, unsigned int val,

0 commit comments

Comments
 (0)