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

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

authored by

Krzysztof Kozlowski and committed by
Mark Brown
d02ea816 788915a2

+2 -2
+2 -2
drivers/regulator/bd71828-regulator.c
··· 95 95 const struct regulator_desc *desc, 96 96 struct regulator_config *cfg) 97 97 { 98 - struct bd71828_regulator_data *data; 98 + const struct bd71828_regulator_data *data; 99 99 100 - data = container_of(desc, struct bd71828_regulator_data, desc); 100 + data = container_of_const(desc, struct bd71828_regulator_data, desc); 101 101 102 102 return rohm_regulator_set_dvs_levels(&data->dvs, np, desc, cfg->regmap); 103 103 }