Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: da9121: Constify struct regmap_config

`da9121_1ch_regmap_config` and `da9121_2ch_regmap_config` are not
modified and can be declared as const to move their data to a
read-only section.

The pointer that references those structs has been converted to const
accordingly.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240704-regulator-const-regmap-v1-1-bce0ddef63ea@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Javier Carrasco and committed by
Mark Brown
05db2e27 82fe56c6

+3 -3
+3 -3
drivers/regulator/da9121-regulator.c
··· 865 865 }; 866 866 867 867 /* DA9121 regmap config for 1 channel variants */ 868 - static struct regmap_config da9121_1ch_regmap_config = { 868 + static const struct regmap_config da9121_1ch_regmap_config = { 869 869 .reg_bits = 8, 870 870 .val_bits = 8, 871 871 .max_register = DA9121_REG_OTP_CONFIG_ID, ··· 876 876 }; 877 877 878 878 /* DA9121 regmap config for 2 channel variants */ 879 - static struct regmap_config da9121_2ch_regmap_config = { 879 + static const struct regmap_config da9121_2ch_regmap_config = { 880 880 .reg_bits = 8, 881 881 .val_bits = 8, 882 882 .max_register = DA9121_REG_OTP_CONFIG_ID, ··· 993 993 static int da9121_assign_chip_model(struct i2c_client *i2c, 994 994 struct da9121 *chip) 995 995 { 996 - struct regmap_config *regmap; 996 + const struct regmap_config *regmap; 997 997 int ret = 0; 998 998 999 999 chip->dev = &i2c->dev;