Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: light: cm3232: make struct cm3232_als_info const

Add const qualifier to struct cm3232_als_info. This is read-only data so
it can be made const.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250628-iio-const-data-20-v1-2-2bf90b03f9f1@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

David Lechner and committed by
Jonathan Cameron
50df7043 8f02a8d6

+3 -3
+3 -3
drivers/iio/light/cm3232.c
··· 58 58 int mlux_per_bit_base_it; 59 59 }; 60 60 61 - static struct cm3232_als_info cm3232_als_info_default = { 61 + static const struct cm3232_als_info cm3232_als_info_default = { 62 62 .regs_cmd_default = CM3232_CMD_DEFAULT, 63 63 .hw_id = CM3232_HW_ID, 64 64 .mlux_per_bit = CM3232_MLUX_PER_BIT_DEFAULT, ··· 67 67 68 68 struct cm3232_chip { 69 69 struct i2c_client *client; 70 - struct cm3232_als_info *als_info; 70 + const struct cm3232_als_info *als_info; 71 71 int calibscale; 72 72 u8 regs_cmd; 73 73 u16 regs_als; ··· 198 198 static int cm3232_get_lux(struct cm3232_chip *chip) 199 199 { 200 200 struct i2c_client *client = chip->client; 201 - struct cm3232_als_info *als_info = chip->als_info; 201 + const struct cm3232_als_info *als_info = chip->als_info; 202 202 int ret; 203 203 int val, val2; 204 204 int als_it;