Skip to content

Commit 5af1a4c

Browse files
javiercarrascocruzlag-linaro
authored andcommitted
mfd: retu: Constify read-only regmap structs
The regmap_bus, regmap_irq and regmap_irq_chip structs are not modified and can be declared as const to move their data to a read-only section. The pointer to reference the regmap_irq_chip structs has been converted to const. Signed-off-by: Javier Carrasco <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent a3cf8ba commit 5af1a4c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/mfd/retu-mfd.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ static const struct mfd_cell retu_devs[] = {
6565
}
6666
};
6767

68-
static struct regmap_irq retu_irqs[] = {
68+
static const struct regmap_irq retu_irqs[] = {
6969
[RETU_INT_PWR] = {
7070
.mask = 1 << RETU_INT_PWR,
7171
}
7272
};
7373

74-
static struct regmap_irq_chip retu_irq_chip = {
74+
static const struct regmap_irq_chip retu_irq_chip = {
7575
.name = "RETU",
7676
.irqs = retu_irqs,
7777
.num_irqs = ARRAY_SIZE(retu_irqs),
@@ -101,13 +101,13 @@ static const struct mfd_cell tahvo_devs[] = {
101101
},
102102
};
103103

104-
static struct regmap_irq tahvo_irqs[] = {
104+
static const struct regmap_irq tahvo_irqs[] = {
105105
[TAHVO_INT_VBUS] = {
106106
.mask = 1 << TAHVO_INT_VBUS,
107107
}
108108
};
109109

110-
static struct regmap_irq_chip tahvo_irq_chip = {
110+
static const struct regmap_irq_chip tahvo_irq_chip = {
111111
.name = "TAHVO",
112112
.irqs = tahvo_irqs,
113113
.num_irqs = ARRAY_SIZE(tahvo_irqs),
@@ -120,7 +120,7 @@ static struct regmap_irq_chip tahvo_irq_chip = {
120120
static const struct retu_data {
121121
char *chip_name;
122122
char *companion_name;
123-
struct regmap_irq_chip *irq_chip;
123+
const struct regmap_irq_chip *irq_chip;
124124
const struct mfd_cell *children;
125125
int nchildren;
126126
} retu_data[] = {
@@ -216,7 +216,7 @@ static int retu_regmap_write(void *context, const void *data, size_t count)
216216
return i2c_smbus_write_word_data(i2c, reg, val);
217217
}
218218

219-
static struct regmap_bus retu_bus = {
219+
static const struct regmap_bus retu_bus = {
220220
.read = retu_regmap_read,
221221
.write = retu_regmap_write,
222222
.val_format_endian_default = REGMAP_ENDIAN_NATIVE,

0 commit comments

Comments
 (0)