summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>2025-11-26 17:58:51 +0100
committerMark Brown <broonie@kernel.org>2025-11-26 18:44:32 +0000
commit6341646f7225343f57c8cbcb6a4d25b3270f4111 (patch)
treed43c9c52caa80c561102e3d707a4f18f4f0ea0e4 /drivers
parent03c3bdebaad23d6698a3cb8a11a915d8bdebf28f (diff)
regulator: pf9453: 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-8-eeec378144d4@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/regulator/pf9453-regulator.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/regulator/pf9453-regulator.c b/drivers/regulator/pf9453-regulator.c
index be627f49b617..f92f42fe26b7 100644
--- a/drivers/regulator/pf9453-regulator.c
+++ b/drivers/regulator/pf9453-regulator.c
@@ -550,7 +550,9 @@ static int buck_set_dvs(const struct regulator_desc *desc,
static int pf9453_set_dvs_levels(struct device_node *np, const struct regulator_desc *desc,
struct regulator_config *cfg)
{
- struct pf9453_regulator_desc *data = container_of(desc, struct pf9453_regulator_desc, desc);
+ const struct pf9453_regulator_desc *data = container_of_const(desc,
+ struct pf9453_regulator_desc,
+ desc);
struct pf9453 *pf9453 = dev_get_drvdata(cfg->dev);
const struct pf9453_dvs_config *dvs = &data->dvs;
unsigned int reg, mask;