summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>2025-11-26 17:58:46 +0100
committerMark Brown <broonie@kernel.org>2025-11-26 18:44:28 +0000
commitd02ea816cccae6c02c7c026b5a74bf99a784c9c8 (patch)
tree53bb9baa0318688c0cde36b9c2fa521c28ec5e71
parent788915a22bdfde0925c074056056e7d408c242d0 (diff)
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>
-rw-r--r--drivers/regulator/bd71828-regulator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/bd71828-regulator.c b/drivers/regulator/bd71828-regulator.c
index dd871ffe979c..87de87793fa1 100644
--- a/drivers/regulator/bd71828-regulator.c
+++ b/drivers/regulator/bd71828-regulator.c
@@ -95,9 +95,9 @@ static int buck_set_hw_dvs_levels(struct device_node *np,
const struct regulator_desc *desc,
struct regulator_config *cfg)
{
- struct bd71828_regulator_data *data;
+ const struct bd71828_regulator_data *data;
- data = container_of(desc, struct bd71828_regulator_data, desc);
+ data = container_of_const(desc, struct bd71828_regulator_data, desc);
return rohm_regulator_set_dvs_levels(&data->dvs, np, desc, cfg->regmap);
}