]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
regulator: bd718x7: Constify pointers to 'regulator_desc' wrap struct
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Wed, 26 Nov 2025 16:58:47 +0000 (17:58 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 26 Nov 2025 18:44:29 +0000 (18:44 +0000)
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>
drivers/regulator/bd718x7-regulator.c

index 022d98f3c32a2dfa8f52cdd3c125d41bda8c91a2..426f68443e26ee31bd7883019ae06e4a8fa900b9 100644 (file)
@@ -698,9 +698,9 @@ static int buck_set_hw_dvs_levels(struct device_node *np,
                            const struct regulator_desc *desc,
                            struct regulator_config *cfg)
 {
-       struct bd718xx_regulator_data *data;
+       const struct bd718xx_regulator_data *data;
 
-       data = container_of(desc, struct bd718xx_regulator_data, desc);
+       data = container_of_const(desc, struct bd718xx_regulator_data, desc);
 
        return rohm_regulator_set_dvs_levels(&data->dvs, np, desc, cfg->regmap);
 }