Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae3923a2 authored by Bhumika Goyal's avatar Bhumika Goyal Committed by Wolfram Sang
Browse files

i2c: busses: make i2c_adapter_quirks const



Make these const as they are only stored as a reference in the quirks
field of an i2c_adapter structure, which is const. Done using
Coccinelle.

Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 329430cc
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -809,7 +809,7 @@ static int at91_twi_xfer(struct i2c_adapter *adap, struct i2c_msg *msg, int num)
 * The hardware can handle at most two messages concatenated by a
 * The hardware can handle at most two messages concatenated by a
 * repeated start via it's internal address feature.
 * repeated start via it's internal address feature.
 */
 */
static struct i2c_adapter_quirks at91_twi_quirks = {
static const struct i2c_adapter_quirks at91_twi_quirks = {
	.flags = I2C_AQ_COMB | I2C_AQ_COMB_WRITE_FIRST | I2C_AQ_COMB_SAME_ADDR,
	.flags = I2C_AQ_COMB | I2C_AQ_COMB_WRITE_FIRST | I2C_AQ_COMB_SAME_ADDR,
	.max_comb_1st_msg_len = 3,
	.max_comb_1st_msg_len = 3,
};
};
+1 −1
Original line number Original line Diff line number Diff line
@@ -413,7 +413,7 @@ static const struct i2c_algorithm cpm_i2c_algo = {
};
};


/* CPM_MAX_READ is also limiting writes according to the code! */
/* CPM_MAX_READ is also limiting writes according to the code! */
static struct i2c_adapter_quirks cpm_i2c_quirks = {
static const struct i2c_adapter_quirks cpm_i2c_quirks = {
	.max_num_msgs = CPM_MAXBD,
	.max_num_msgs = CPM_MAXBD,
	.max_read_len = CPM_MAX_READ,
	.max_read_len = CPM_MAX_READ,
	.max_write_len = CPM_MAX_READ,
	.max_write_len = CPM_MAX_READ,
+1 −1
Original line number Original line Diff line number Diff line
@@ -433,7 +433,7 @@ static const struct i2c_algorithm mlxcpld_i2c_algo = {
	.functionality	= mlxcpld_i2c_func
	.functionality	= mlxcpld_i2c_func
};
};


static struct i2c_adapter_quirks mlxcpld_i2c_quirks = {
static const struct i2c_adapter_quirks mlxcpld_i2c_quirks = {
	.flags = I2C_AQ_COMB_WRITE_THEN_READ,
	.flags = I2C_AQ_COMB_WRITE_THEN_READ,
	.max_read_len = MLXCPLD_I2C_DATA_REG_SZ - MLXCPLD_I2C_MAX_ADDR_LEN,
	.max_read_len = MLXCPLD_I2C_DATA_REG_SZ - MLXCPLD_I2C_MAX_ADDR_LEN,
	.max_write_len = MLXCPLD_I2C_DATA_REG_SZ,
	.max_write_len = MLXCPLD_I2C_DATA_REG_SZ,
+1 −1
Original line number Original line Diff line number Diff line
@@ -204,7 +204,7 @@ static const struct i2c_algorithm i2c_opal_algo = {
 * For two messages, we basically support simple smbus transactions of a
 * For two messages, we basically support simple smbus transactions of a
 * write-then-anything.
 * write-then-anything.
 */
 */
static struct i2c_adapter_quirks i2c_opal_quirks = {
static const struct i2c_adapter_quirks i2c_opal_quirks = {
	.flags = I2C_AQ_COMB | I2C_AQ_COMB_WRITE_FIRST | I2C_AQ_COMB_SAME_ADDR,
	.flags = I2C_AQ_COMB | I2C_AQ_COMB_WRITE_FIRST | I2C_AQ_COMB_SAME_ADDR,
	.max_comb_1st_msg_len = 4,
	.max_comb_1st_msg_len = 4,
};
};
+1 −1
Original line number Original line Diff line number Diff line
@@ -197,7 +197,7 @@ static const struct i2c_algorithm i2c_powermac_algorithm = {
	.functionality	= i2c_powermac_func,
	.functionality	= i2c_powermac_func,
};
};


static struct i2c_adapter_quirks i2c_powermac_quirks = {
static const struct i2c_adapter_quirks i2c_powermac_quirks = {
	.max_num_msgs = 1,
	.max_num_msgs = 1,
};
};


Loading