regulator: mt6358: Const-ify mt6358_regulator_info data structures
authorChen-Yu Tsai <wenst@chromium.org>
Fri, 9 Jun 2023 08:30:02 +0000 (16:30 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 14 Jun 2023 13:25:47 +0000 (14:25 +0100)
commit1ff35e66cae53f7090a671afddaee45d4ccd9396
treebb5d4c8d9ef722dfc2a8d9cad4d6f39dedd7ffe1
parent04ba665248ed91576d326041108e5fc2ec2254eb
regulator: mt6358: Const-ify mt6358_regulator_info data structures

In the MT6358 regulator driver, each regulator is described by a
|struct regulator_desc| wrapped by a |struct mt6358_regulator_info|.
The latter was tied to the regulator device using the config's
driver_data field, which meant that the variables could not be constant.

Since each regulator device has a pointer to its regulator_desc, and
mt6358_regulator_info wraps that, the driver could use container_of()
to retrieve it instead.

Switch to using container_of(), drop tha driver_data setting, and
const-ify all the regulator descriptions.

Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20230609083009.2822259-6-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/mt6358-regulator.c