Skip to content

Commit f21711b

Browse files
t-8chbroonie
authored andcommitted
regmap-irq: handle const struct regmap_irq_sub_irq_map
The struct instances supplied by the drivers are never modified. Handle them as const in the regmap core allowing the drivers to put them into .rodata. Also add a new entry to const_structs.checkpatch to make sure future instances of this struct already enter the tree as const. Signed-off-by: Thomas Weißschuh <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 0f02ba4 commit f21711b

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

drivers/base/regmap/regmap-irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ static inline int read_sub_irq_data(struct regmap_irq_chip_data *data,
305305
unsigned int b)
306306
{
307307
const struct regmap_irq_chip *chip = data->chip;
308+
const struct regmap_irq_sub_irq_map *subreg;
308309
struct regmap *map = data->map;
309-
struct regmap_irq_sub_irq_map *subreg;
310310
unsigned int reg;
311311
int i, ret = 0;
312312

include/linux/regmap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,7 @@ struct regmap_irq_chip {
16071607

16081608
unsigned int main_status;
16091609
unsigned int num_main_status_bits;
1610-
struct regmap_irq_sub_irq_map *sub_reg_offsets;
1610+
const struct regmap_irq_sub_irq_map *sub_reg_offsets;
16111611
int num_main_regs;
16121612

16131613
unsigned int status_base;

scripts/const_structs.checkpatch

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ regmap_bus
7272
regmap_config
7373
regmap_irq
7474
regmap_irq_chip
75+
regmap_irq_sub_irq_map
7576
regmap_range
7677
regmap_range_cfg
7778
regulator_ops

0 commit comments

Comments
 (0)