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

Configure Feed

Select the types of activity you want to include in your feed.

mfd: da9062-core: Constify read-only regmap structs

`da9061_regmap_{config,irq,irq_chip}` and `da9062_{config,irq,irq_chip}`
are not modified and can be declared as const to move their data to a
read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240704-mfd-const-regmap_config-v2-1-0c8785b1331d@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Javier Carrasco and committed by
Lee Jones
c5416d4b 03bd3683

+6 -6
+6 -6
drivers/mfd/da9062-core.c
··· 25 25 #define DA9062_IRQ_LOW 0 26 26 #define DA9062_IRQ_HIGH 1 27 27 28 - static struct regmap_irq da9061_irqs[] = { 28 + static const struct regmap_irq da9061_irqs[] = { 29 29 /* EVENT A */ 30 30 [DA9061_IRQ_ONKEY] = { 31 31 .reg_offset = DA9062_REG_EVENT_A_OFFSET, ··· 79 79 }, 80 80 }; 81 81 82 - static struct regmap_irq_chip da9061_irq_chip = { 82 + static const struct regmap_irq_chip da9061_irq_chip = { 83 83 .name = "da9061-irq", 84 84 .irqs = da9061_irqs, 85 85 .num_irqs = DA9061_NUM_IRQ, ··· 89 89 .ack_base = DA9062AA_EVENT_A, 90 90 }; 91 91 92 - static struct regmap_irq da9062_irqs[] = { 92 + static const struct regmap_irq da9062_irqs[] = { 93 93 /* EVENT A */ 94 94 [DA9062_IRQ_ONKEY] = { 95 95 .reg_offset = DA9062_REG_EVENT_A_OFFSET, ··· 151 151 }, 152 152 }; 153 153 154 - static struct regmap_irq_chip da9062_irq_chip = { 154 + static const struct regmap_irq_chip da9062_irq_chip = { 155 155 .name = "da9062-irq", 156 156 .irqs = da9062_irqs, 157 157 .num_irqs = DA9062_NUM_IRQ, ··· 470 470 } 471 471 }; 472 472 473 - static struct regmap_config da9061_regmap_config = { 473 + static const struct regmap_config da9061_regmap_config = { 474 474 .reg_bits = 8, 475 475 .val_bits = 8, 476 476 .ranges = da9061_range_cfg, ··· 576 576 } 577 577 }; 578 578 579 - static struct regmap_config da9062_regmap_config = { 579 + static const struct regmap_config da9062_regmap_config = { 580 580 .reg_bits = 8, 581 581 .val_bits = 8, 582 582 .ranges = da9062_range_cfg,