Skip to content

Commit 14e01b5

Browse files
osctobebroonie
authored andcommitted
regmap-i2c: constify regmap_bus structures
regmap_bus structures are not changed anywhere. Mark them const. Signed-off-by: Michał Mirosław <[email protected]> Link: https://lore.kernel.org/r/85e4141348db00ecf1f2bc5c2ff6ba3de75e8ff4.1578134920.git.mirq-linux@rere.qmqm.pl Signed-off-by: Mark Brown <[email protected]>
1 parent e42617b commit 14e01b5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/base/regmap/regmap-i2c.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static int regmap_smbus_byte_reg_write(void *context, unsigned int reg,
4343
return i2c_smbus_write_byte_data(i2c, reg, val);
4444
}
4545

46-
static struct regmap_bus regmap_smbus_byte = {
46+
static const struct regmap_bus regmap_smbus_byte = {
4747
.reg_write = regmap_smbus_byte_reg_write,
4848
.reg_read = regmap_smbus_byte_reg_read,
4949
};
@@ -79,7 +79,7 @@ static int regmap_smbus_word_reg_write(void *context, unsigned int reg,
7979
return i2c_smbus_write_word_data(i2c, reg, val);
8080
}
8181

82-
static struct regmap_bus regmap_smbus_word = {
82+
static const struct regmap_bus regmap_smbus_word = {
8383
.reg_write = regmap_smbus_word_reg_write,
8484
.reg_read = regmap_smbus_word_reg_read,
8585
};
@@ -115,7 +115,7 @@ static int regmap_smbus_word_write_swapped(void *context, unsigned int reg,
115115
return i2c_smbus_write_word_swapped(i2c, reg, val);
116116
}
117117

118-
static struct regmap_bus regmap_smbus_word_swapped = {
118+
static const struct regmap_bus regmap_smbus_word_swapped = {
119119
.reg_write = regmap_smbus_word_write_swapped,
120120
.reg_read = regmap_smbus_word_read_swapped,
121121
};
@@ -197,7 +197,7 @@ static int regmap_i2c_read(void *context,
197197
return -EIO;
198198
}
199199

200-
static struct regmap_bus regmap_i2c = {
200+
static const struct regmap_bus regmap_i2c = {
201201
.write = regmap_i2c_write,
202202
.gather_write = regmap_i2c_gather_write,
203203
.read = regmap_i2c_read,
@@ -239,7 +239,7 @@ static int regmap_i2c_smbus_i2c_read(void *context, const void *reg,
239239
return -EIO;
240240
}
241241

242-
static struct regmap_bus regmap_i2c_smbus_i2c_block = {
242+
static const struct regmap_bus regmap_i2c_smbus_i2c_block = {
243243
.write = regmap_i2c_smbus_i2c_write,
244244
.read = regmap_i2c_smbus_i2c_read,
245245
.max_raw_read = I2C_SMBUS_BLOCK_MAX,

0 commit comments

Comments
 (0)