]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mfd: Constify reg_sequence and regmap_irq
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Wed, 28 May 2025 19:44:17 +0000 (21:44 +0200)
committerLee Jones <lee@kernel.org>
Thu, 24 Jul 2025 10:26:55 +0000 (11:26 +0100)
Static 'struct reg_sequence' array, 'struct regmap_irq_sub_irq_map' and
'struct regmap_irq_chip ' are not modified so can be changed to const
for more safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20250528194416.567127-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/cs40l50-core.c
drivers/mfd/rohm-bd71828.c
drivers/mfd/tps65219.c
drivers/mfd/twl6040.c

index 4859a33777a04ca2c39fc2a9418ee3f04b39bbc3..c91bccda085886574a00470b64af215ab8d643f2 100644 (file)
@@ -52,7 +52,7 @@ static const struct regmap_irq cs40l50_reg_irqs[] = {
                       CS40L50_GLOBAL_ERROR_MASK),
 };
 
-static struct regmap_irq_chip cs40l50_irq_chip = {
+static const struct regmap_irq_chip cs40l50_irq_chip = {
        .name =         "cs40l50",
        .status_base =  CS40L50_IRQ1_INT_1,
        .mask_base =    CS40L50_IRQ1_MASK_1,
index 738d8b3b9ffedb48320e1459c1b8068f0ee5a3ba..47e574a57077633a38b774ee6e56f549c8cbf125 100644 (file)
@@ -223,7 +223,7 @@ static unsigned int bit5_offsets[] = {3};           /* VSYS IRQ */
 static unsigned int bit6_offsets[] = {1, 2};           /* DCIN IRQ */
 static unsigned int bit7_offsets[] = {0};              /* BUCK IRQ */
 
-static struct regmap_irq_sub_irq_map bd718xx_sub_irq_offsets[] = {
+static const struct regmap_irq_sub_irq_map bd718xx_sub_irq_offsets[] = {
        REGMAP_IRQ_MAIN_REG_OFFSET(bit0_offsets),
        REGMAP_IRQ_MAIN_REG_OFFSET(bit1_offsets),
        REGMAP_IRQ_MAIN_REG_OFFSET(bit2_offsets),
index 297511025dd4648682ddfcb7922863da2cd8bfe1..f6387345457ec748097b0fcc483affdca4e14b13 100644 (file)
@@ -238,7 +238,7 @@ static unsigned int tps65214_bit4_offsets[] = { TPS65214_REG_INT_BUCK_3_POS };
 static unsigned int tps65214_bit5_offsets[] = { TPS65214_REG_INT_LDO_1_2_POS };
 static unsigned int tps65214_bit7_offsets[] = { TPS65214_REG_INT_PB_POS };
 
-static struct regmap_irq_sub_irq_map tps65219_sub_irq_offsets[] = {
+static const struct regmap_irq_sub_irq_map tps65219_sub_irq_offsets[] = {
        REGMAP_IRQ_MAIN_REG_OFFSET(bit0_offsets),
        REGMAP_IRQ_MAIN_REG_OFFSET(bit1_offsets),
        REGMAP_IRQ_MAIN_REG_OFFSET(bit2_offsets),
@@ -249,7 +249,7 @@ static struct regmap_irq_sub_irq_map tps65219_sub_irq_offsets[] = {
        REGMAP_IRQ_MAIN_REG_OFFSET(bit7_offsets),
 };
 
-static struct regmap_irq_sub_irq_map tps65215_sub_irq_offsets[] = {
+static const struct regmap_irq_sub_irq_map tps65215_sub_irq_offsets[] = {
        REGMAP_IRQ_MAIN_REG_OFFSET(bit0_offsets),
        REGMAP_IRQ_MAIN_REG_OFFSET(bit1_offsets),
        REGMAP_IRQ_MAIN_REG_OFFSET(bit2_offsets),
index 218d6195fad201ca45854a075e63281efd165689..562a0f939f6e56cd078cedc57e4ef5e2395ed1cc 100644 (file)
@@ -69,7 +69,7 @@ static const struct reg_default twl6040_defaults[] = {
        { 0x2E, 0x00 }, /* REG_STATUS   (ro) */
 };
 
-static struct reg_sequence twl6040_patch[] = {
+static const struct reg_sequence twl6040_patch[] = {
        /*
         * Select I2C bus access to dual access registers
         * Interrupt register is cleared on read