Skip to content

Commit 7a7e1ed

Browse files
krzkbroonie
authored andcommitted
regulator: bd718x7: Constify pointers to 'regulator_desc' wrap struct
Pointer to 'struct regulator_desc' is a pointer to const and the wrapping structure (container) is not being modified, thus entire syntax can be replaced to preferred and safer container_of_const(). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20251126-container-of-const-regulator-v1-4-eeec378144d4@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent d02ea81 commit 7a7e1ed

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/regulator/bd718x7-regulator.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,9 +698,9 @@ static int buck_set_hw_dvs_levels(struct device_node *np,
698698
const struct regulator_desc *desc,
699699
struct regulator_config *cfg)
700700
{
701-
struct bd718xx_regulator_data *data;
701+
const struct bd718xx_regulator_data *data;
702702

703-
data = container_of(desc, struct bd718xx_regulator_data, desc);
703+
data = container_of_const(desc, struct bd718xx_regulator_data, desc);
704704

705705
return rohm_regulator_set_dvs_levels(&data->dvs, np, desc, cfg->regmap);
706706
}

0 commit comments

Comments
 (0)