Skip to content

Commit

Permalink
hwmon: Don't overuse I2C_CLIENT_MODULE_PARM
Browse files Browse the repository at this point in the history
I2C_CLIENT_MODULE_PARM is overkill for force_subclients. We really
only use 4 out of the 48 slots, so we're better defining a custom
variable instead. This change saves 92 bytes of data for each of the
five drivers affected.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Marc Hulsman <m.hulsman@tudelft.nl>
Cc: Mark M. Hoffman <mhoffman@lightlink.com>
  • Loading branch information
Jean Delvare committed Jan 7, 2009
1 parent 6e34b18 commit 3aed198
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
5 changes: 4 additions & 1 deletion drivers/hwmon/asb100.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ static const unsigned short normal_i2c[] = { 0x2d, I2C_CLIENT_END };

/* Insmod parameters */
I2C_CLIENT_INSMOD_1(asb100);
I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: "

static unsigned short force_subclients[4];
module_param_array(force_subclients, short, NULL, 0);
MODULE_PARM_DESC(force_subclients, "List of subclient addresses: "
"{bus, clientaddr, subclientaddr1, subclientaddr2}");

/* Voltage IN registers 0-6 */
Expand Down
5 changes: 4 additions & 1 deletion drivers/hwmon/w83781d.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ static const unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, I2C_CLIENT_END };
/* Insmod parameters */
I2C_CLIENT_INSMOD_4(w83781d, w83782d, w83783s, as99127f);
I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: "

static unsigned short force_subclients[4];
module_param_array(force_subclients, short, NULL, 0);
MODULE_PARM_DESC(force_subclients, "List of subclient addresses: "
"{bus, clientaddr, subclientaddr1, subclientaddr2}");

static int reset;
Expand Down
5 changes: 4 additions & 1 deletion drivers/hwmon/w83791d.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f,

/* Insmod parameters */
I2C_CLIENT_INSMOD_1(w83791d);
I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: "

static unsigned short force_subclients[4];
module_param_array(force_subclients, short, NULL, 0);
MODULE_PARM_DESC(force_subclients, "List of subclient addresses: "
"{bus, clientaddr, subclientaddr1, subclientaddr2}");

static int reset;
Expand Down
5 changes: 4 additions & 1 deletion drivers/hwmon/w83792d.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f,

/* Insmod parameters */
I2C_CLIENT_INSMOD_1(w83792d);
I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: "

static unsigned short force_subclients[4];
module_param_array(force_subclients, short, NULL, 0);
MODULE_PARM_DESC(force_subclients, "List of subclient addresses: "
"{bus, clientaddr, subclientaddr1, subclientaddr2}");

static int init;
Expand Down
5 changes: 4 additions & 1 deletion drivers/hwmon/w83793.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f,

/* Insmod parameters */
I2C_CLIENT_INSMOD_1(w83793);
I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: "

static unsigned short force_subclients[4];
module_param_array(force_subclients, short, NULL, 0);
MODULE_PARM_DESC(force_subclients, "List of subclient addresses: "
"{bus, clientaddr, subclientaddr1, subclientaddr2}");

static int reset;
Expand Down

0 comments on commit 3aed198

Please sign in to comment.