i2c: busses: constify i2c_algorithm structures
authorBhumika Goyal <bhumirks@gmail.com>
Fri, 27 Jan 2017 18:06:17 +0000 (23:36 +0530)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 9 Feb 2017 16:06:52 +0000 (17:06 +0100)
Declare i2c_algorithm structures as const as they are only stored in the
algo field of an i2c_adapter structure. This field is of type const, so
i2c_algorithm structures having this property can be made const too.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> for
Acked-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
14 files changed:
drivers/i2c/busses/i2c-at91.c
drivers/i2c/busses/i2c-bfin-twi.c
drivers/i2c/busses/i2c-designware-core.c
drivers/i2c/busses/i2c-eg20t.c
drivers/i2c/busses/i2c-emev2.c
drivers/i2c/busses/i2c-imx-lpi2c.c
drivers/i2c/busses/i2c-imx.c
drivers/i2c/busses/i2c-nforce2.c
drivers/i2c/busses/i2c-robotfuzz-osif.c
drivers/i2c/busses/i2c-sh_mobile.c
drivers/i2c/busses/i2c-st.c
drivers/i2c/busses/i2c-xgene-slimpro.c
drivers/i2c/busses/i2c-xlp9xx.c
drivers/i2c/busses/i2c-xlr.c

index 0b86c61..e4fcb0c 100644 (file)
@@ -820,7 +820,7 @@ static u32 at91_twi_func(struct i2c_adapter *adapter)
                | I2C_FUNC_SMBUS_READ_BLOCK_DATA;
 }
 
-static struct i2c_algorithm at91_twi_algorithm = {
+static const struct i2c_algorithm at91_twi_algorithm = {
        .master_xfer    = at91_twi_xfer,
        .functionality  = at91_twi_func,
 };
index 29d00c4..9fe942b 100644 (file)
@@ -563,7 +563,7 @@ static u32 bfin_twi_functionality(struct i2c_adapter *adap)
               I2C_FUNC_I2C | I2C_FUNC_SMBUS_I2C_BLOCK;
 }
 
-static struct i2c_algorithm bfin_twi_algorithm = {
+static const struct i2c_algorithm bfin_twi_algorithm = {
        .master_xfer   = bfin_twi_master_xfer,
        .smbus_xfer    = bfin_twi_smbus_xfer,
        .functionality = bfin_twi_functionality,
index 6d81c56..a62c14c 100644 (file)
@@ -822,7 +822,7 @@ static u32 i2c_dw_func(struct i2c_adapter *adap)
        return dev->functionality;
 }
 
-static struct i2c_algorithm i2c_dw_algo = {
+static const struct i2c_algorithm i2c_dw_algo = {
        .master_xfer    = i2c_dw_xfer,
        .functionality  = i2c_dw_func,
 };
index 5ce71ce..bdeab01 100644 (file)
@@ -715,7 +715,7 @@ static u32 pch_i2c_func(struct i2c_adapter *adap)
        return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | I2C_FUNC_10BIT_ADDR;
 }
 
-static struct i2c_algorithm pch_algorithm = {
+static const struct i2c_algorithm pch_algorithm = {
        .master_xfer = pch_i2c_xfer,
        .functionality = pch_i2c_func
 };
index 96bb4e7..3129127 100644 (file)
@@ -347,7 +347,7 @@ static int em_i2c_unreg_slave(struct i2c_client *slave)
        return 0;
 }
 
-static struct i2c_algorithm em_i2c_algo = {
+static const struct i2c_algorithm em_i2c_algo = {
        .master_xfer = em_i2c_xfer,
        .functionality = em_i2c_func,
        .reg_slave      = em_i2c_reg_slave,
index c62b7cd..934f548 100644 (file)
@@ -537,7 +537,7 @@ static u32 lpi2c_imx_func(struct i2c_adapter *adapter)
                I2C_FUNC_SMBUS_READ_BLOCK_DATA;
 }
 
-static struct i2c_algorithm lpi2c_imx_algo = {
+static const struct i2c_algorithm lpi2c_imx_algo = {
        .master_xfer    = lpi2c_imx_xfer,
        .functionality  = lpi2c_imx_func,
 };
index 47fc1f1..95ed171 100644 (file)
@@ -1037,7 +1037,7 @@ static u32 i2c_imx_func(struct i2c_adapter *adapter)
                | I2C_FUNC_SMBUS_READ_BLOCK_DATA;
 }
 
-static struct i2c_algorithm i2c_imx_algo = {
+static const struct i2c_algorithm i2c_imx_algo = {
        .master_xfer    = i2c_imx_xfer,
        .functionality  = i2c_imx_func,
 };
index 374b35e..3241bb9 100644 (file)
@@ -296,7 +296,7 @@ static u32 nforce2_func(struct i2c_adapter *adapter)
                I2C_FUNC_SMBUS_BLOCK_DATA : 0);
 }
 
-static struct i2c_algorithm smbus_algorithm = {
+static const struct i2c_algorithm smbus_algorithm = {
        .smbus_xfer     = nforce2_access,
        .functionality  = nforce2_func,
 };
index 89d8b41..9c0f52b 100644 (file)
@@ -117,7 +117,7 @@ static u32 osif_func(struct i2c_adapter *adapter)
        return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
 }
 
-static struct i2c_algorithm osif_algorithm = {
+static const struct i2c_algorithm osif_algorithm = {
        .master_xfer    = osif_xfer,
        .functionality  = osif_func,
 };
index 3d9ebe6..3d75593 100644 (file)
@@ -781,7 +781,7 @@ static u32 sh_mobile_i2c_func(struct i2c_adapter *adapter)
        return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | I2C_FUNC_PROTOCOL_MANGLING;
 }
 
-static struct i2c_algorithm sh_mobile_i2c_algorithm = {
+static const struct i2c_algorithm sh_mobile_i2c_algorithm = {
        .functionality  = sh_mobile_i2c_func,
        .master_xfer    = sh_mobile_i2c_xfer,
 };
index 1371547..1eb9fa8 100644 (file)
@@ -776,7 +776,7 @@ static u32 st_i2c_func(struct i2c_adapter *adap)
        return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
 }
 
-static struct i2c_algorithm st_i2c_algo = {
+static const struct i2c_algorithm st_i2c_algo = {
        .master_xfer = st_i2c_xfer,
        .functionality = st_i2c_func,
 };
index 0ab1e55..dbe7e44 100644 (file)
@@ -372,7 +372,7 @@ static u32 xgene_slimpro_i2c_func(struct i2c_adapter *adapter)
                I2C_FUNC_SMBUS_I2C_BLOCK;
 }
 
-static struct i2c_algorithm xgene_slimpro_i2c_algorithm = {
+static const struct i2c_algorithm xgene_slimpro_i2c_algorithm = {
        .smbus_xfer = xgene_slimpro_i2c_xfer,
        .functionality = xgene_slimpro_i2c_func,
 };
index 84a8b2e..66b464d 100644 (file)
@@ -334,7 +334,7 @@ static u32 xlp9xx_i2c_functionality(struct i2c_adapter *adapter)
                I2C_FUNC_10BIT_ADDR;
 }
 
-static struct i2c_algorithm xlp9xx_i2c_algo = {
+static const struct i2c_algorithm xlp9xx_i2c_algo = {
        .master_xfer = xlp9xx_i2c_xfer,
        .functionality = xlp9xx_i2c_functionality,
 };
index ad17d88..484bfa1 100644 (file)
@@ -335,7 +335,7 @@ static u32 xlr_func(struct i2c_adapter *adap)
        return (I2C_FUNC_SMBUS_EMUL & ~I2C_FUNC_SMBUS_QUICK) | I2C_FUNC_I2C;
 }
 
-static struct i2c_algorithm xlr_i2c_algo = {
+static const struct i2c_algorithm xlr_i2c_algo = {
        .master_xfer    = xlr_i2c_xfer,
        .functionality  = xlr_func,
 };