regmap: constify regmap_bus structures
authorJulia Lawall <Julia.Lawall@lip6.fr>
Fri, 11 Aug 2017 06:57:36 +0000 (08:57 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 14 Aug 2017 16:36:29 +0000 (17:36 +0100)
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>
drivers/base/regmap/regmap-spi.c
drivers/base/regmap/regmap-spmi.c

index edd9a839d004dcf98ab46b15c9002c958ad6fe56..c7150dd264d5806ca2fd0581b7c972c79949920e 100644 (file)
@@ -102,7 +102,7 @@ static int regmap_spi_read(void *context,
        return spi_write_then_read(spi, reg, reg_size, val, val_size);
 }
 
-static struct regmap_bus regmap_spi = {
+static const struct regmap_bus regmap_spi = {
        .write = regmap_spi_write,
        .gather_write = regmap_spi_gather_write,
        .async_write = regmap_spi_async_write,
index 4a36e415e938560ce2e3ba927b81888444767a7d..0bfb8ed244d50c054f3a1d88d78a32ea942930eb 100644 (file)
@@ -83,7 +83,7 @@ static int regmap_spmi_base_write(void *context, const void *data,
                                             count - 1);
 }
 
-static struct regmap_bus regmap_spmi_base = {
+static const struct regmap_bus regmap_spmi_base = {
        .read                           = regmap_spmi_base_read,
        .write                          = regmap_spmi_base_write,
        .gather_write                   = regmap_spmi_base_gather_write,
@@ -203,7 +203,7 @@ static int regmap_spmi_ext_write(void *context, const void *data,
                                            count - 2);
 }
 
-static struct regmap_bus regmap_spmi_ext = {
+static const struct regmap_bus regmap_spmi_ext = {
        .read                           = regmap_spmi_ext_read,
        .write                          = regmap_spmi_ext_write,
        .gather_write                   = regmap_spmi_ext_gather_write,