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

index be627f49b61762bb2b3a1830c14ae3a7255034e2..f92f42fe26b76fe76b124159b08dd3decc98be18 100644 (file)
@@ -550,7 +550,9 @@ static int buck_set_dvs(const struct regulator_desc *desc,
 static int pf9453_set_dvs_levels(struct device_node *np, const struct regulator_desc *desc,
                                 struct regulator_config *cfg)
 {
-       struct pf9453_regulator_desc *data = container_of(desc, struct pf9453_regulator_desc, desc);
+       const struct pf9453_regulator_desc *data = container_of_const(desc,
+                                                                     struct pf9453_regulator_desc,
+                                                                     desc);
        struct pf9453 *pf9453 = dev_get_drvdata(cfg->dev);
        const struct pf9453_dvs_config *dvs = &data->dvs;
        unsigned int reg, mask;