Skip to content

Commit 6341646

Browse files
krzkbroonie
authored andcommitted
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>
1 parent 03c3bde commit 6341646

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/regulator/pf9453-regulator.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,9 @@ static int buck_set_dvs(const struct regulator_desc *desc,
550550
static int pf9453_set_dvs_levels(struct device_node *np, const struct regulator_desc *desc,
551551
struct regulator_config *cfg)
552552
{
553-
struct pf9453_regulator_desc *data = container_of(desc, struct pf9453_regulator_desc, desc);
553+
const struct pf9453_regulator_desc *data = container_of_const(desc,
554+
struct pf9453_regulator_desc,
555+
desc);
554556
struct pf9453 *pf9453 = dev_get_drvdata(cfg->dev);
555557
const struct pf9453_dvs_config *dvs = &data->dvs;
556558
unsigned int reg, mask;

0 commit comments

Comments
 (0)