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

mfd: Constify reg_sequence and regmap_irq

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>

authored by

Krzysztof Kozlowski and committed by
Lee Jones
2d23e749 e40fc116

+5 -5
+1 -1
drivers/mfd/cs40l50-core.c
··· 52 52 CS40L50_GLOBAL_ERROR_MASK), 53 53 }; 54 54 55 - static struct regmap_irq_chip cs40l50_irq_chip = { 55 + static const struct regmap_irq_chip cs40l50_irq_chip = { 56 56 .name = "cs40l50", 57 57 .status_base = CS40L50_IRQ1_INT_1, 58 58 .mask_base = CS40L50_IRQ1_MASK_1,
+1 -1
drivers/mfd/rohm-bd71828.c
··· 223 223 static unsigned int bit6_offsets[] = {1, 2}; /* DCIN IRQ */ 224 224 static unsigned int bit7_offsets[] = {0}; /* BUCK IRQ */ 225 225 226 - static struct regmap_irq_sub_irq_map bd718xx_sub_irq_offsets[] = { 226 + static const struct regmap_irq_sub_irq_map bd718xx_sub_irq_offsets[] = { 227 227 REGMAP_IRQ_MAIN_REG_OFFSET(bit0_offsets), 228 228 REGMAP_IRQ_MAIN_REG_OFFSET(bit1_offsets), 229 229 REGMAP_IRQ_MAIN_REG_OFFSET(bit2_offsets),
+2 -2
drivers/mfd/tps65219.c
··· 238 238 static unsigned int tps65214_bit5_offsets[] = { TPS65214_REG_INT_LDO_1_2_POS }; 239 239 static unsigned int tps65214_bit7_offsets[] = { TPS65214_REG_INT_PB_POS }; 240 240 241 - static struct regmap_irq_sub_irq_map tps65219_sub_irq_offsets[] = { 241 + static const struct regmap_irq_sub_irq_map tps65219_sub_irq_offsets[] = { 242 242 REGMAP_IRQ_MAIN_REG_OFFSET(bit0_offsets), 243 243 REGMAP_IRQ_MAIN_REG_OFFSET(bit1_offsets), 244 244 REGMAP_IRQ_MAIN_REG_OFFSET(bit2_offsets), ··· 249 249 REGMAP_IRQ_MAIN_REG_OFFSET(bit7_offsets), 250 250 }; 251 251 252 - static struct regmap_irq_sub_irq_map tps65215_sub_irq_offsets[] = { 252 + static const struct regmap_irq_sub_irq_map tps65215_sub_irq_offsets[] = { 253 253 REGMAP_IRQ_MAIN_REG_OFFSET(bit0_offsets), 254 254 REGMAP_IRQ_MAIN_REG_OFFSET(bit1_offsets), 255 255 REGMAP_IRQ_MAIN_REG_OFFSET(bit2_offsets),
+1 -1
drivers/mfd/twl6040.c
··· 69 69 { 0x2E, 0x00 }, /* REG_STATUS (ro) */ 70 70 }; 71 71 72 - static struct reg_sequence twl6040_patch[] = { 72 + static const struct reg_sequence twl6040_patch[] = { 73 73 /* 74 74 * Select I2C bus access to dual access registers 75 75 * Interrupt register is cleared on read