diff options
author | Rikard Falkeborn <rikard.falkeborn@gmail.com> | 2022-03-31 00:41:10 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-04-04 10:41:50 +0300 |
commit | bd941dfaae3503c6b707d8544696205f759e57a3 (patch) | |
tree | aad56e3c71e0f02ce9525c764e3155a33fe2fb9c /drivers/base/regmap | |
parent | 3123109284176b1532874591f7c81f3837bbdc17 (diff) | |
download | linux-bd941dfaae3503c6b707d8544696205f759e57a3.tar.xz |
regmap: Constify static regmap_bus structs
The only usage of these is to pass their address to __regmap_init() or
__devm_regmap_init(), both which takes pointers to const struct
regmap_bus. Make them const to allow the compiler to put them in
read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20220330214110.36337-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/base/regmap')
-rw-r--r-- | drivers/base/regmap/regmap-i3c.c | 2 | ||||
-rw-r--r-- | drivers/base/regmap/regmap-sccb.c | 2 | ||||
-rw-r--r-- | drivers/base/regmap/regmap-sdw-mbq.c | 2 | ||||
-rw-r--r-- | drivers/base/regmap/regmap-sdw.c | 2 | ||||
-rw-r--r-- | drivers/base/regmap/regmap-slimbus.c | 2 | ||||
-rw-r--r-- | drivers/base/regmap/regmap-w1.c | 6 |
6 files changed, 8 insertions, 8 deletions
diff --git a/drivers/base/regmap/regmap-i3c.c b/drivers/base/regmap/regmap-i3c.c index 1578fb506683..0328b0b34284 100644 --- a/drivers/base/regmap/regmap-i3c.c +++ b/drivers/base/regmap/regmap-i3c.c @@ -40,7 +40,7 @@ static int regmap_i3c_read(void *context, return i3c_device_do_priv_xfers(i3c, xfers, 2); } -static struct regmap_bus regmap_i3c = { +static const struct regmap_bus regmap_i3c = { .write = regmap_i3c_write, .read = regmap_i3c_read, }; diff --git a/drivers/base/regmap/regmap-sccb.c b/drivers/base/regmap/regmap-sccb.c index 597042e2d009..986af26d88c2 100644 --- a/drivers/base/regmap/regmap-sccb.c +++ b/drivers/base/regmap/regmap-sccb.c @@ -80,7 +80,7 @@ static int regmap_sccb_write(void *context, unsigned int reg, unsigned int val) return i2c_smbus_write_byte_data(i2c, reg, val); } -static struct regmap_bus regmap_sccb_bus = { +static const struct regmap_bus regmap_sccb_bus = { .reg_write = regmap_sccb_write, .reg_read = regmap_sccb_read, }; diff --git a/drivers/base/regmap/regmap-sdw-mbq.c b/drivers/base/regmap/regmap-sdw-mbq.c index fe3ac26b66ad..388c3a087bd9 100644 --- a/drivers/base/regmap/regmap-sdw-mbq.c +++ b/drivers/base/regmap/regmap-sdw-mbq.c @@ -42,7 +42,7 @@ static int regmap_sdw_mbq_read(void *context, unsigned int reg, unsigned int *va return 0; } -static struct regmap_bus regmap_sdw_mbq = { +static const struct regmap_bus regmap_sdw_mbq = { .reg_read = regmap_sdw_mbq_read, .reg_write = regmap_sdw_mbq_write, .reg_format_endian_default = REGMAP_ENDIAN_LITTLE, diff --git a/drivers/base/regmap/regmap-sdw.c b/drivers/base/regmap/regmap-sdw.c index 966de8a136d9..81b0327f719d 100644 --- a/drivers/base/regmap/regmap-sdw.c +++ b/drivers/base/regmap/regmap-sdw.c @@ -30,7 +30,7 @@ static int regmap_sdw_read(void *context, unsigned int reg, unsigned int *val) return 0; } -static struct regmap_bus regmap_sdw = { +static const struct regmap_bus regmap_sdw = { .reg_read = regmap_sdw_read, .reg_write = regmap_sdw_write, .reg_format_endian_default = REGMAP_ENDIAN_LITTLE, diff --git a/drivers/base/regmap/regmap-slimbus.c b/drivers/base/regmap/regmap-slimbus.c index 0968059f1ef5..8075db788b39 100644 --- a/drivers/base/regmap/regmap-slimbus.c +++ b/drivers/base/regmap/regmap-slimbus.c @@ -22,7 +22,7 @@ static int regmap_slimbus_read(void *context, const void *reg, size_t reg_size, return slim_read(sdev, *(u16 *)reg, val_size, val); } -static struct regmap_bus regmap_slimbus_bus = { +static const struct regmap_bus regmap_slimbus_bus = { .write = regmap_slimbus_write, .read = regmap_slimbus_read, .reg_format_endian_default = REGMAP_ENDIAN_LITTLE, diff --git a/drivers/base/regmap/regmap-w1.c b/drivers/base/regmap/regmap-w1.c index 1fbaaad71ca5..3a8b402db852 100644 --- a/drivers/base/regmap/regmap-w1.c +++ b/drivers/base/regmap/regmap-w1.c @@ -172,17 +172,17 @@ static int w1_reg_a16_v16_write(void *context, unsigned int reg, * Various types of supported bus addressing */ -static struct regmap_bus regmap_w1_bus_a8_v8 = { +static const struct regmap_bus regmap_w1_bus_a8_v8 = { .reg_read = w1_reg_a8_v8_read, .reg_write = w1_reg_a8_v8_write, }; -static struct regmap_bus regmap_w1_bus_a8_v16 = { +static const struct regmap_bus regmap_w1_bus_a8_v16 = { .reg_read = w1_reg_a8_v16_read, .reg_write = w1_reg_a8_v16_write, }; -static struct regmap_bus regmap_w1_bus_a16_v16 = { +static const struct regmap_bus regmap_w1_bus_a16_v16 = { .reg_read = w1_reg_a16_v16_read, .reg_write = w1_reg_a16_v16_write, }; |