Skip to content

Commit 05db2e2

Browse files
javiercarrascocruzbroonie
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 82fe56c commit 05db2e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/regulator/da9121-regulator.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ static const struct regmap_access_table da9121_volatile_table = {
865865
};
866866

867867
/* 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 = {
869869
.reg_bits = 8,
870870
.val_bits = 8,
871871
.max_register = DA9121_REG_OTP_CONFIG_ID,
@@ -876,7 +876,7 @@ static struct regmap_config da9121_1ch_regmap_config = {
876876
};
877877

878878
/* 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 = {
880880
.reg_bits = 8,
881881
.val_bits = 8,
882882
.max_register = DA9121_REG_OTP_CONFIG_ID,
@@ -993,7 +993,7 @@ static int da9121_check_device_type(struct i2c_client *i2c, struct da9121 *chip)
993993
static int da9121_assign_chip_model(struct i2c_client *i2c,
994994
struct da9121 *chip)
995995
{
996-
struct regmap_config *regmap;
996+
const struct regmap_config *regmap;
997997
int ret = 0;
998998

999999
chip->dev = &i2c->dev;

0 commit comments

Comments
 (0)