summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorNishka Dasgupta <nishkadg.linux@gmail.com>2019-08-19 09:46:01 +0200
committerWolfram Sang <wsa@the-dreams.de>2019-08-29 22:10:01 +0200
commitf9bf7a899412b5f8c96b084343bde4168dc12efa (patch)
tree5b37eb7b1880a2e59761e6d5439d748afe9936f2 /drivers/i2c
parenti2c: designware-pci: Add support for Elkhart Lake PSE I2C (diff)
downloadlinux-f9bf7a899412b5f8c96b084343bde4168dc12efa.tar.xz
linux-f9bf7a899412b5f8c96b084343bde4168dc12efa.zip
i2c: taos-evm: Make structure tsl2550_info constant
Static structure tsl2550_info, of type i2c_board_info, is referenced only twice: the first time in arguments to dev_info() (which does not modify it) and the second time as the last argument to function i2c_new_device() (where the corresponding parameter is declared as const). As tsl2550_info is therefore never modified, make it const to protect it from unintended modifications. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-taos-evm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-taos-evm.c b/drivers/i2c/busses/i2c-taos-evm.c
index c82e78f57386..056df6b2538a 100644
--- a/drivers/i2c/busses/i2c-taos-evm.c
+++ b/drivers/i2c/busses/i2c-taos-evm.c
@@ -39,7 +39,7 @@ struct taos_data {
};
/* TAOS TSL2550 EVM */
-static struct i2c_board_info tsl2550_info = {
+static const struct i2c_board_info tsl2550_info = {
I2C_BOARD_INFO("tsl2550", 0x39),
};