Skip to content

Commit 2a9f899

Browse files
javiercarrascocruzlag-linaro
authored andcommitted
mfd: 88pm80x: Constify read-only regmap structs
`pm800_irq`, `pm805_irq` and `pm805_irq_chip` are not modified and can be declared as const to move their data to a read-only section. In order to keep the const modifier for the regmap_irq_chip structures, the pointer used to reference them must be converted to const as well. Signed-off-by: Javier Carrasco <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 9842c62 commit 2a9f899

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

drivers/mfd/88pm800.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ static void device_irq_exit_800(struct pm80x_chip *chip)
391391
regmap_del_irq_chip(chip->irq, chip->irq_data);
392392
}
393393

394-
static struct regmap_irq_chip pm800_irq_chip = {
394+
static const struct regmap_irq_chip pm800_irq_chip = {
395395
.name = "88pm800",
396396
.irqs = pm800_irqs,
397397
.num_irqs = ARRAY_SIZE(pm800_irqs),

drivers/mfd/88pm805.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static const struct mfd_cell codec_devs[] = {
7373
},
7474
};
7575

76-
static struct regmap_irq pm805_irqs[] = {
76+
static const struct regmap_irq pm805_irqs[] = {
7777
/* INT0 */
7878
[PM805_IRQ_LDO_OFF] = {
7979
.mask = PM805_INT1_HP1_SHRT,
@@ -163,7 +163,7 @@ static void device_irq_exit_805(struct pm80x_chip *chip)
163163
regmap_del_irq_chip(chip->irq, chip->irq_data);
164164
}
165165

166-
static struct regmap_irq_chip pm805_irq_chip = {
166+
static const struct regmap_irq_chip pm805_irq_chip = {
167167
.name = "88pm805",
168168
.irqs = pm805_irqs,
169169
.num_irqs = ARRAY_SIZE(pm805_irqs),

include/linux/mfd/88pm80x.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ struct pm80x_chip {
294294
struct i2c_client *client;
295295
struct i2c_client *companion;
296296
struct regmap *regmap;
297-
struct regmap_irq_chip *regmap_irq_chip;
297+
const struct regmap_irq_chip *regmap_irq_chip;
298298
struct regmap_irq_chip_data *irq_data;
299299
int type;
300300
int irq;

0 commit comments

Comments
 (0)