Commit 918ee91c071d6248c48bc6457a6dea286146e3ad
Committed by
Jean Delvare
1 parent
bd5f47ec96
Exists in
master
and in
39 other branches
hwmon: I2C addresses are constant
We can mark normal_i2c const. Almost all drivers do that already, so fix the 3 remaining ones before they are used as (bad) examples for new drivers. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: George Joseph <george.joseph@fairview5.com> Reviewed-by: Guenter Roeck <guenter.roeck@ericsson.com>
Showing 3 changed files with 5 additions and 5 deletions Side-by-side Diff
drivers/hwmon/adt7475.c
... | ... | @@ -146,7 +146,7 @@ |
146 | 146 | #define TEMP_OFFSET_REG(idx) (REG_TEMP_OFFSET_BASE + (idx)) |
147 | 147 | #define TEMP_TRANGE_REG(idx) (REG_TEMP_TRANGE_BASE + (idx)) |
148 | 148 | |
149 | -static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | |
149 | +static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | |
150 | 150 | |
151 | 151 | enum chips { adt7473, adt7475, adt7476, adt7490 }; |
152 | 152 |
drivers/hwmon/asc7621.c
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 | #include <linux/mutex.h> |
29 | 29 | |
30 | 30 | /* Addresses to scan */ |
31 | -static unsigned short normal_i2c[] = { | |
31 | +static const unsigned short normal_i2c[] = { | |
32 | 32 | 0x2c, 0x2d, 0x2e, I2C_CLIENT_END |
33 | 33 | }; |
34 | 34 | |
... | ... | @@ -52,7 +52,7 @@ |
52 | 52 | u8 company_id; |
53 | 53 | u8 verstep_reg; |
54 | 54 | u8 verstep_id; |
55 | - unsigned short *addresses; | |
55 | + const unsigned short *addresses; | |
56 | 56 | }; |
57 | 57 | |
58 | 58 | static struct asc7621_chip asc7621_chips[] = { |
drivers/hwmon/tmp421.c
... | ... | @@ -36,8 +36,8 @@ |
36 | 36 | #include <linux/sysfs.h> |
37 | 37 | |
38 | 38 | /* Addresses to scan */ |
39 | -static unsigned short normal_i2c[] = { 0x2a, 0x4c, 0x4d, 0x4e, 0x4f, | |
40 | - I2C_CLIENT_END }; | |
39 | +static const unsigned short normal_i2c[] = { 0x2a, 0x4c, 0x4d, 0x4e, 0x4f, | |
40 | + I2C_CLIENT_END }; | |
41 | 41 | |
42 | 42 | enum chips { tmp421, tmp422, tmp423 }; |
43 | 43 |