Skip to content

Commit 438e90a

Browse files
krzkbroonie
authored andcommitted
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>
1 parent 50011ca commit 438e90a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/regulator/mt6358-regulator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct mt6358_regulator_info {
3131
u32 modeset_mask;
3232
};
3333

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)
3535

3636
#define MT6358_BUCK(match, vreg, supply, min, max, step, \
3737
vosel_mask, _da_vsel_reg, _da_vsel_mask, \

0 commit comments

Comments
 (0)