Skip to content

Commit a8c4b0c

Browse files
javiercarrascocruzlag-linaro
authored andcommitted
mfd: rohm-bd71828: Constify read-only regmap structs
The 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. Signed-off-by: Javier Carrasco <[email protected]> Reviewed-by: Matti Vaittinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 6e2a75b commit a8c4b0c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/mfd/rohm-bd71828.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ static const struct regmap_irq bd71815_irqs[] = {
316316
REGMAP_IRQ_REG(BD71815_INT_RTC2, 11, BD71815_INT_RTC2_MASK),
317317
};
318318

319-
static struct regmap_irq bd71828_irqs[] = {
319+
static const struct regmap_irq bd71828_irqs[] = {
320320
REGMAP_IRQ_REG(BD71828_INT_BUCK1_OCP, 0, BD71828_INT_BUCK1_OCP_MASK),
321321
REGMAP_IRQ_REG(BD71828_INT_BUCK2_OCP, 0, BD71828_INT_BUCK2_OCP_MASK),
322322
REGMAP_IRQ_REG(BD71828_INT_BUCK3_OCP, 0, BD71828_INT_BUCK3_OCP_MASK),
@@ -407,7 +407,7 @@ static struct regmap_irq bd71828_irqs[] = {
407407
REGMAP_IRQ_REG(BD71828_INT_RTC2, 11, BD71828_INT_RTC2_MASK),
408408
};
409409

410-
static struct regmap_irq_chip bd71828_irq_chip = {
410+
static const struct regmap_irq_chip bd71828_irq_chip = {
411411
.name = "bd71828_irq",
412412
.main_status = BD71828_REG_INT_MAIN,
413413
.irqs = &bd71828_irqs[0],
@@ -423,7 +423,7 @@ static struct regmap_irq_chip bd71828_irq_chip = {
423423
.irq_reg_stride = 1,
424424
};
425425

426-
static struct regmap_irq_chip bd71815_irq_chip = {
426+
static const struct regmap_irq_chip bd71815_irq_chip = {
427427
.name = "bd71815_irq",
428428
.main_status = BD71815_REG_INT_STAT,
429429
.irqs = &bd71815_irqs[0],
@@ -491,7 +491,7 @@ static int bd71828_i2c_probe(struct i2c_client *i2c)
491491
int ret;
492492
struct regmap *regmap;
493493
const struct regmap_config *regmap_config;
494-
struct regmap_irq_chip *irqchip;
494+
const struct regmap_irq_chip *irqchip;
495495
unsigned int chip_type;
496496
struct mfd_cell *mfd;
497497
int cells;

0 commit comments

Comments
 (0)