Skip to content

Commit

Permalink
hwmon: I2C addresses are constant
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jean Delvare authored and Jean Delvare committed Oct 28, 2010
1 parent bd5f47e commit 918ee91
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers/hwmon/adt7475.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
#define TEMP_OFFSET_REG(idx) (REG_TEMP_OFFSET_BASE + (idx))
#define TEMP_TRANGE_REG(idx) (REG_TEMP_TRANGE_BASE + (idx))

static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };

enum chips { adt7473, adt7475, adt7476, adt7490 };

Expand Down
4 changes: 2 additions & 2 deletions drivers/hwmon/asc7621.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <linux/mutex.h>

/* Addresses to scan */
static unsigned short normal_i2c[] = {
static const unsigned short normal_i2c[] = {
0x2c, 0x2d, 0x2e, I2C_CLIENT_END
};

Expand All @@ -52,7 +52,7 @@ struct asc7621_chip {
u8 company_id;
u8 verstep_reg;
u8 verstep_id;
unsigned short *addresses;
const unsigned short *addresses;
};

static struct asc7621_chip asc7621_chips[] = {
Expand Down
4 changes: 2 additions & 2 deletions drivers/hwmon/tmp421.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
#include <linux/sysfs.h>

/* Addresses to scan */
static unsigned short normal_i2c[] = { 0x2a, 0x4c, 0x4d, 0x4e, 0x4f,
I2C_CLIENT_END };
static const unsigned short normal_i2c[] = { 0x2a, 0x4c, 0x4d, 0x4e, 0x4f,
I2C_CLIENT_END };

enum chips { tmp421, tmp422, tmp423 };

Expand Down

0 comments on commit 918ee91

Please sign in to comment.