Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regmap: constify regmap_bus structures

These regmap_bus structures are only passed as the second argument to
__devm_regmap_init or __regmap_init, both of which are const, so the
regmap_bus structures can be const too.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Julia Lawall and committed by
Mark Brown
9c2e5cb3 5771a8c0

+3 -3
+1 -1
drivers/base/regmap/regmap-spi.c
··· 102 102 return spi_write_then_read(spi, reg, reg_size, val, val_size); 103 103 } 104 104 105 - static struct regmap_bus regmap_spi = { 105 + static const struct regmap_bus regmap_spi = { 106 106 .write = regmap_spi_write, 107 107 .gather_write = regmap_spi_gather_write, 108 108 .async_write = regmap_spi_async_write,
+2 -2
drivers/base/regmap/regmap-spmi.c
··· 83 83 count - 1); 84 84 } 85 85 86 - static struct regmap_bus regmap_spmi_base = { 86 + static const struct regmap_bus regmap_spmi_base = { 87 87 .read = regmap_spmi_base_read, 88 88 .write = regmap_spmi_base_write, 89 89 .gather_write = regmap_spmi_base_gather_write, ··· 203 203 count - 2); 204 204 } 205 205 206 - static struct regmap_bus regmap_spmi_ext = { 206 + static const struct regmap_bus regmap_spmi_ext = { 207 207 .read = regmap_spmi_ext_read, 208 208 .write = regmap_spmi_ext_write, 209 209 .gather_write = regmap_spmi_ext_gather_write,