Skip to content

Commit

Permalink
regulator: da9121: Constify struct regmap_config
Browse files Browse the repository at this point in the history
`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]>
  • Loading branch information
javiercarrascocruz authored and broonie committed Jul 4, 2024
1 parent 82fe56c commit 05db2e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/regulator/da9121-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -993,7 +993,7 @@ static int da9121_check_device_type(struct i2c_client *i2c, struct da9121 *chip)
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;
Expand Down

0 comments on commit 05db2e2

Please sign in to comment.