Commit 92d9d0df authored by Bhumika Goyal's avatar Bhumika Goyal Committed by Wolfram Sang

i2c: busses: constify i2c_algorithm structures

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: default avatarBhumika Goyal <bhumirks@gmail.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> for
Acked-by: default avatarPatrice Chotard <patrice.chotard@st.com>
Acked-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: default avatarJean Delvare <jdelvare@suse.de>
Acked-by: default avatarLudovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 6b66a6f2
...@@ -820,7 +820,7 @@ static u32 at91_twi_func(struct i2c_adapter *adapter) ...@@ -820,7 +820,7 @@ static u32 at91_twi_func(struct i2c_adapter *adapter)
| I2C_FUNC_SMBUS_READ_BLOCK_DATA; | 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, .master_xfer = at91_twi_xfer,
.functionality = at91_twi_func, .functionality = at91_twi_func,
}; };
......
...@@ -563,7 +563,7 @@ static u32 bfin_twi_functionality(struct i2c_adapter *adap) ...@@ -563,7 +563,7 @@ static u32 bfin_twi_functionality(struct i2c_adapter *adap)
I2C_FUNC_I2C | I2C_FUNC_SMBUS_I2C_BLOCK; 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, .master_xfer = bfin_twi_master_xfer,
.smbus_xfer = bfin_twi_smbus_xfer, .smbus_xfer = bfin_twi_smbus_xfer,
.functionality = bfin_twi_functionality, .functionality = bfin_twi_functionality,
......
...@@ -822,7 +822,7 @@ static u32 i2c_dw_func(struct i2c_adapter *adap) ...@@ -822,7 +822,7 @@ static u32 i2c_dw_func(struct i2c_adapter *adap)
return dev->functionality; return dev->functionality;
} }
static struct i2c_algorithm i2c_dw_algo = { static const struct i2c_algorithm i2c_dw_algo = {
.master_xfer = i2c_dw_xfer, .master_xfer = i2c_dw_xfer,
.functionality = i2c_dw_func, .functionality = i2c_dw_func,
}; };
......
...@@ -715,7 +715,7 @@ static u32 pch_i2c_func(struct i2c_adapter *adap) ...@@ -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; 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, .master_xfer = pch_i2c_xfer,
.functionality = pch_i2c_func .functionality = pch_i2c_func
}; };
......
...@@ -347,7 +347,7 @@ static int em_i2c_unreg_slave(struct i2c_client *slave) ...@@ -347,7 +347,7 @@ static int em_i2c_unreg_slave(struct i2c_client *slave)
return 0; return 0;
} }
static struct i2c_algorithm em_i2c_algo = { static const struct i2c_algorithm em_i2c_algo = {
.master_xfer = em_i2c_xfer, .master_xfer = em_i2c_xfer,
.functionality = em_i2c_func, .functionality = em_i2c_func,
.reg_slave = em_i2c_reg_slave, .reg_slave = em_i2c_reg_slave,
......
...@@ -537,7 +537,7 @@ static u32 lpi2c_imx_func(struct i2c_adapter *adapter) ...@@ -537,7 +537,7 @@ static u32 lpi2c_imx_func(struct i2c_adapter *adapter)
I2C_FUNC_SMBUS_READ_BLOCK_DATA; 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, .master_xfer = lpi2c_imx_xfer,
.functionality = lpi2c_imx_func, .functionality = lpi2c_imx_func,
}; };
......
...@@ -1037,7 +1037,7 @@ static u32 i2c_imx_func(struct i2c_adapter *adapter) ...@@ -1037,7 +1037,7 @@ static u32 i2c_imx_func(struct i2c_adapter *adapter)
| I2C_FUNC_SMBUS_READ_BLOCK_DATA; | 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, .master_xfer = i2c_imx_xfer,
.functionality = i2c_imx_func, .functionality = i2c_imx_func,
}; };
......
...@@ -296,7 +296,7 @@ static u32 nforce2_func(struct i2c_adapter *adapter) ...@@ -296,7 +296,7 @@ static u32 nforce2_func(struct i2c_adapter *adapter)
I2C_FUNC_SMBUS_BLOCK_DATA : 0); I2C_FUNC_SMBUS_BLOCK_DATA : 0);
} }
static struct i2c_algorithm smbus_algorithm = { static const struct i2c_algorithm smbus_algorithm = {
.smbus_xfer = nforce2_access, .smbus_xfer = nforce2_access,
.functionality = nforce2_func, .functionality = nforce2_func,
}; };
......
...@@ -117,7 +117,7 @@ static u32 osif_func(struct i2c_adapter *adapter) ...@@ -117,7 +117,7 @@ static u32 osif_func(struct i2c_adapter *adapter)
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; 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, .master_xfer = osif_xfer,
.functionality = osif_func, .functionality = osif_func,
}; };
......
...@@ -781,7 +781,7 @@ static u32 sh_mobile_i2c_func(struct i2c_adapter *adapter) ...@@ -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; 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, .functionality = sh_mobile_i2c_func,
.master_xfer = sh_mobile_i2c_xfer, .master_xfer = sh_mobile_i2c_xfer,
}; };
......
...@@ -776,7 +776,7 @@ static u32 st_i2c_func(struct i2c_adapter *adap) ...@@ -776,7 +776,7 @@ static u32 st_i2c_func(struct i2c_adapter *adap)
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; 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, .master_xfer = st_i2c_xfer,
.functionality = st_i2c_func, .functionality = st_i2c_func,
}; };
......
...@@ -372,7 +372,7 @@ static u32 xgene_slimpro_i2c_func(struct i2c_adapter *adapter) ...@@ -372,7 +372,7 @@ static u32 xgene_slimpro_i2c_func(struct i2c_adapter *adapter)
I2C_FUNC_SMBUS_I2C_BLOCK; 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, .smbus_xfer = xgene_slimpro_i2c_xfer,
.functionality = xgene_slimpro_i2c_func, .functionality = xgene_slimpro_i2c_func,
}; };
......
...@@ -334,7 +334,7 @@ static u32 xlp9xx_i2c_functionality(struct i2c_adapter *adapter) ...@@ -334,7 +334,7 @@ static u32 xlp9xx_i2c_functionality(struct i2c_adapter *adapter)
I2C_FUNC_10BIT_ADDR; I2C_FUNC_10BIT_ADDR;
} }
static struct i2c_algorithm xlp9xx_i2c_algo = { static const struct i2c_algorithm xlp9xx_i2c_algo = {
.master_xfer = xlp9xx_i2c_xfer, .master_xfer = xlp9xx_i2c_xfer,
.functionality = xlp9xx_i2c_functionality, .functionality = xlp9xx_i2c_functionality,
}; };
......
...@@ -335,7 +335,7 @@ static u32 xlr_func(struct i2c_adapter *adap) ...@@ -335,7 +335,7 @@ static u32 xlr_func(struct i2c_adapter *adap)
return (I2C_FUNC_SMBUS_EMUL & ~I2C_FUNC_SMBUS_QUICK) | I2C_FUNC_I2C; 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, .master_xfer = xlr_i2c_xfer,
.functionality = xlr_func, .functionality = xlr_func,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment