]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
regulator: da9121: Constify struct regmap_config
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>
Thu, 4 Jul 2024 18:13:07 +0000 (20:13 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 4 Jul 2024 18:15:54 +0000 (19:15 +0100)
`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>
drivers/regulator/da9121-regulator.c

index 3571b6242e3a50577c7e057639d5d57470183b74..d97162f737939f4f8782a7ab9bfa616285892075 100644 (file)
@@ -865,7 +865,7 @@ static const struct regmap_access_table da9121_volatile_table = {
 };
 
 /* DA9121 regmap config for 1 channel variants */
-static struct regmap_config da9121_1ch_regmap_config = {
+static const struct regmap_config da9121_1ch_regmap_config = {
        .reg_bits = 8,
        .val_bits = 8,
        .max_register = DA9121_REG_OTP_CONFIG_ID,
@@ -876,7 +876,7 @@ static struct regmap_config da9121_1ch_regmap_config = {
 };
 
 /* DA9121 regmap config for 2 channel variants */
-static struct regmap_config da9121_2ch_regmap_config = {
+static const struct regmap_config da9121_2ch_regmap_config = {
        .reg_bits = 8,
        .val_bits = 8,
        .max_register = DA9121_REG_OTP_CONFIG_ID,
@@ -993,7 +993,7 @@ error:
 static int da9121_assign_chip_model(struct i2c_client *i2c,
                        struct da9121 *chip)
 {
-       struct regmap_config *regmap;
+       const struct regmap_config *regmap;
        int ret = 0;
 
        chip->dev = &i2c->dev;