]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
regulator: mtk-dvfsrc: Constify static data
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 9 Sep 2024 13:51:22 +0000 (15:51 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 10 Sep 2024 11:44:12 +0000 (12:44 +0100)
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>
drivers/regulator/mtk-dvfsrc-regulator.c

index 9bf4163221f1b8e73c657d004e69f31f282208c5..f5662c569464275d7f6c43ba07f31b6068f099ee 100644 (file)
@@ -19,7 +19,7 @@ enum dvfsrc_regulator_id {
 };
 
 struct dvfsrc_regulator_pdata {
-       struct regulator_desc *descs;
+       const struct regulator_desc *descs;
        u32 size;
 };
 
@@ -107,7 +107,7 @@ static const unsigned int mt6873_voltages[] = {
        725000,
 };
 
-static struct regulator_desc mt6873_regulators[] = {
+static const struct regulator_desc mt6873_regulators[] = {
        MTK_DVFSRC_VREG("dvfsrc-vcore", VCORE, mt6873_voltages),
        MTK_DVFSRC_VREG("dvfsrc-vscp", VSCP, mt6873_voltages),
 };
@@ -122,7 +122,7 @@ static const unsigned int mt8183_voltages[] = {
        800000,
 };
 
-static struct regulator_desc mt8183_regulators[] = {
+static const struct regulator_desc mt8183_regulators[] = {
        MTK_DVFSRC_VREG("dvfsrc-vcore", VCORE, mt8183_voltages),
 };
 
@@ -138,7 +138,7 @@ static const unsigned int mt8195_voltages[] = {
        750000,
 };
 
-static struct regulator_desc mt8195_regulators[] = {
+static const struct regulator_desc mt8195_regulators[] = {
        MTK_DVFSRC_VREG("dvfsrc-vcore", VCORE, mt8195_voltages),
        MTK_DVFSRC_VREG("dvfsrc-vscp", VSCP, mt8195_voltages),
 };
@@ -159,7 +159,7 @@ static int dvfsrc_vcore_regulator_probe(struct platform_device *pdev)
                return -EINVAL;
 
        for (i = 0; i < pdata->size; i++) {
-               struct regulator_desc *vrdesc = &pdata->descs[i];
+               const struct regulator_desc *vrdesc = &pdata->descs[i];
                struct regulator_dev *rdev;
 
                rdev = devm_regulator_register(&pdev->dev, vrdesc, &config);