Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: mt6358: 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-6-eeec378144d4@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Mark Brown
438e90a2 50011cac

+1 -1
+1 -1
drivers/regulator/mt6358-regulator.c
··· 31 31 u32 modeset_mask; 32 32 }; 33 33 34 - #define to_regulator_info(x) container_of((x), struct mt6358_regulator_info, desc) 34 + #define to_regulator_info(x) container_of_const((x), struct mt6358_regulator_info, desc) 35 35 36 36 #define MT6358_BUCK(match, vreg, supply, min, max, step, \ 37 37 vosel_mask, _da_vsel_reg, _da_vsel_mask, \