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 0b86c6173e073806a4d0021a6f98cacfa082566a..e4fcb0c2bc97975b814a6bda5eb8c00faf1e42e6 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 29d00c4f7824c2b3a9deaa41749567a07eb2c123..9fe942b8c6104713e349436add398b1acabb8eb5 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 6d81c56184d33d4757414fd748ace9013c8a3b14..a62c14c3b2b7e1b1fd854b884154f33daef08216 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 5ce71ce7b6c43b7ce8fd7e7586127650c5e2e508..bdeab0174fec2099b4572bbe9dea6bd9d32514db 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 96bb4e7490128c9e72e21df107cba70752e3f807..3129127088542728e2f2e73993a956f2d589800a 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 c62b7cd475f87694bd9eeacba60ae2b75733ff79..934f5485f3c57cd7b05c30de9a11a208e0dc4240 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 47fc1f1acff7db60a6cf909a43f6d443c04ca91e..95ed17183e73e904e06b13c383bee28410797172 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 374b35e7e450ce55ea97f7438864100c90f68b66..3241bb9d6c186985ae11d38c1e7511b6d4aaea1d 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 89d8b41b66680f8ab4326ded52168452675d54be..9c0f52b7ff7ec4a04660c4fe2b00d471463531a9 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 3d9ebe6e57166eb1ef240b9cfdaa7b680e2105b7..3d75593487454cfb9ca6b837d43a756a5fbc79c7 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 1371547ce1a3a811dae12cdea2bd0592ec4342f7..1eb9fa82dcfd9261cb2aa67a5fb07c2cce3724de 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 0ab1e55558bcd7a520afd8dcf07ae3d8cb77e1c0..dbe7e44c9321279bbcd7b3f8d2006dbe1365e0b7 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 84a8b2eccffb2d0d35991ff278409c09ca424e72..66b464d52c9c12623d61786041f75b8ab6b22d52 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 ad17d88d857361663ae98d8faff52a0d9cedbeab..484bfa15d58ee445aee64097c36f7f271463f0c8 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,
 };