]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
power: supply: bq25980_charger: Constify reg_default array
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Wed, 28 May 2025 19:44:41 +0000 (21:44 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Sun, 22 Jun 2025 17:21:11 +0000 (19:21 +0200)
Static 'struct reg_default' array is not modified so can be changed to
const for more safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250528194439.567263-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/bq25980_charger.c

index 4ff76e3dddf63ff0f9a80fbba6e64c75f0451496..723858d62d1414f65d9b5a17f64ed6a5a620d802 100644 (file)
@@ -104,7 +104,7 @@ struct bq25980_device {
        int watchdog_timer;
 };
 
-static struct reg_default bq25980_reg_defs[] = {
+static const struct reg_default bq25980_reg_defs[] = {
        {BQ25980_BATOVP, 0x5A},
        {BQ25980_BATOVP_ALM, 0x46},
        {BQ25980_BATOCP, 0x51},
@@ -159,7 +159,7 @@ static struct reg_default bq25980_reg_defs[] = {
        {BQ25980_CHRGR_CTRL_6, 0x0},
 };
 
-static struct reg_default bq25975_reg_defs[] = {
+static const struct reg_default bq25975_reg_defs[] = {
        {BQ25980_BATOVP, 0x5A},
        {BQ25980_BATOVP_ALM, 0x46},
        {BQ25980_BATOCP, 0x51},
@@ -214,7 +214,7 @@ static struct reg_default bq25975_reg_defs[] = {
        {BQ25980_CHRGR_CTRL_6, 0x0},
 };
 
-static struct reg_default bq25960_reg_defs[] = {
+static const struct reg_default bq25960_reg_defs[] = {
        {BQ25980_BATOVP, 0x5A},
        {BQ25980_BATOVP_ALM, 0x46},
        {BQ25980_BATOCP, 0x51},