From: Krzysztof Kozlowski Date: Wed, 26 Nov 2025 16:58:51 +0000 (+0100) Subject: regulator: pf9453: Constify pointers to 'regulator_desc' wrap struct X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6341646f7225343f57c8cbcb6a4d25b3270f4111;p=thirdparty%2Flinux.git 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 Link: https://patch.msgid.link/20251126-container-of-const-regulator-v1-8-eeec378144d4@oss.qualcomm.com Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/pf9453-regulator.c b/drivers/regulator/pf9453-regulator.c index be627f49b6176..f92f42fe26b76 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;