Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: mtk-dvfsrc: Constify static data

Driver does not modify static data with regulator description (struct
regulator_desc), so make it const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240909-regulator-const-v1-11-8934704a5787@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Mark Brown
90b94a05 96d7ee7c

+5 -5
+5 -5
drivers/regulator/mtk-dvfsrc-regulator.c
··· 19 19 }; 20 20 21 21 struct dvfsrc_regulator_pdata { 22 - struct regulator_desc *descs; 22 + const struct regulator_desc *descs; 23 23 u32 size; 24 24 }; 25 25 ··· 107 107 725000, 108 108 }; 109 109 110 - static struct regulator_desc mt6873_regulators[] = { 110 + static const struct regulator_desc mt6873_regulators[] = { 111 111 MTK_DVFSRC_VREG("dvfsrc-vcore", VCORE, mt6873_voltages), 112 112 MTK_DVFSRC_VREG("dvfsrc-vscp", VSCP, mt6873_voltages), 113 113 }; ··· 122 122 800000, 123 123 }; 124 124 125 - static struct regulator_desc mt8183_regulators[] = { 125 + static const struct regulator_desc mt8183_regulators[] = { 126 126 MTK_DVFSRC_VREG("dvfsrc-vcore", VCORE, mt8183_voltages), 127 127 }; 128 128 ··· 138 138 750000, 139 139 }; 140 140 141 - static struct regulator_desc mt8195_regulators[] = { 141 + static const struct regulator_desc mt8195_regulators[] = { 142 142 MTK_DVFSRC_VREG("dvfsrc-vcore", VCORE, mt8195_voltages), 143 143 MTK_DVFSRC_VREG("dvfsrc-vscp", VSCP, mt8195_voltages), 144 144 }; ··· 159 159 return -EINVAL; 160 160 161 161 for (i = 0; i < pdata->size; i++) { 162 - struct regulator_desc *vrdesc = &pdata->descs[i]; 162 + const struct regulator_desc *vrdesc = &pdata->descs[i]; 163 163 struct regulator_dev *rdev; 164 164 165 165 rdev = devm_regulator_register(&pdev->dev, vrdesc, &config);