mfd: rohm-bd71828: Constify read-only regmap structs
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>
Thu, 4 Jul 2024 17:23:23 +0000 (19:23 +0200)
committerLee Jones <lee@kernel.org>
Fri, 30 Aug 2024 08:40:12 +0000 (09:40 +0100)
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 <javier.carrasco.cruz@gmail.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/20240704-mfd-const-regmap_config-v2-13-0c8785b1331d@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/rohm-bd71828.c

index 5b4290f116fc78ca3ea13d64035cd3782fdbbb82..39f7514aa3d875fbd1a32a8a1e953a06fb2b84f5 100644 (file)
@@ -316,7 +316,7 @@ static const struct regmap_irq bd71815_irqs[] = {
        REGMAP_IRQ_REG(BD71815_INT_RTC2, 11, BD71815_INT_RTC2_MASK),
 };
 
-static struct regmap_irq bd71828_irqs[] = {
+static const struct regmap_irq bd71828_irqs[] = {
        REGMAP_IRQ_REG(BD71828_INT_BUCK1_OCP, 0, BD71828_INT_BUCK1_OCP_MASK),
        REGMAP_IRQ_REG(BD71828_INT_BUCK2_OCP, 0, BD71828_INT_BUCK2_OCP_MASK),
        REGMAP_IRQ_REG(BD71828_INT_BUCK3_OCP, 0, BD71828_INT_BUCK3_OCP_MASK),
@@ -407,7 +407,7 @@ static struct regmap_irq bd71828_irqs[] = {
        REGMAP_IRQ_REG(BD71828_INT_RTC2, 11, BD71828_INT_RTC2_MASK),
 };
 
-static struct regmap_irq_chip bd71828_irq_chip = {
+static const struct regmap_irq_chip bd71828_irq_chip = {
        .name = "bd71828_irq",
        .main_status = BD71828_REG_INT_MAIN,
        .irqs = &bd71828_irqs[0],
@@ -423,7 +423,7 @@ static struct regmap_irq_chip bd71828_irq_chip = {
        .irq_reg_stride = 1,
 };
 
-static struct regmap_irq_chip bd71815_irq_chip = {
+static const struct regmap_irq_chip bd71815_irq_chip = {
        .name = "bd71815_irq",
        .main_status = BD71815_REG_INT_STAT,
        .irqs = &bd71815_irqs[0],
@@ -491,7 +491,7 @@ static int bd71828_i2c_probe(struct i2c_client *i2c)
        int ret;
        struct regmap *regmap;
        const struct regmap_config *regmap_config;
-       struct regmap_irq_chip *irqchip;
+       const struct regmap_irq_chip *irqchip;
        unsigned int chip_type;
        struct mfd_cell *mfd;
        int cells;