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

index e4745f616cea3b461ac3131a3f885536412c1014..2604f674be493be13c4d698cf1046b261e1a7eec 100644 (file)
@@ -31,7 +31,7 @@ struct mt6358_regulator_info {
        u32 modeset_mask;
 };
 
-#define to_regulator_info(x) container_of((x), struct mt6358_regulator_info, desc)
+#define to_regulator_info(x) container_of_const((x), struct mt6358_regulator_info, desc)
 
 #define MT6358_BUCK(match, vreg, supply, min, max, step,       \
                    vosel_mask, _da_vsel_reg, _da_vsel_mask,    \