diff options
author | Jean Delvare <khali@linux-fr.org> | 2007-05-01 17:26:29 -0400 |
---|---|---|
committer | Jean Delvare <khali@hyperion.delvare> | 2007-05-01 17:26:29 -0400 |
commit | cacf2269b6cde2ff2c29a13dff5ce6886ff1dc73 (patch) | |
tree | 4945c308b0ba8114d396794e57bf3bcb08ff6a83 | |
parent | 3c4bb241d34ee3d9ab87aad265734885385f179b (diff) |
i2c-parport: Optimize binary size
Initialize the fields of the i2c_adapter structure individually,
rather than copying a whole static template structure. This shaves
off 474 bytes or 14% (on i386) from the binary size.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
-rw-r--r-- | drivers/i2c/busses/i2c-parport.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c index 66696a40c7b5..b9f1c5c7b572 100644 --- a/drivers/i2c/busses/i2c-parport.c +++ b/drivers/i2c/busses/i2c-parport.c | |||
@@ -143,13 +143,6 @@ static struct i2c_algo_bit_data parport_algo_data = { | |||
143 | 143 | ||
144 | /* ----- I2c and parallel port call-back functions and structures --------- */ | 144 | /* ----- I2c and parallel port call-back functions and structures --------- */ |
145 | 145 | ||
146 | static struct i2c_adapter parport_adapter = { | ||
147 | .owner = THIS_MODULE, | ||
148 | .class = I2C_CLASS_HWMON, | ||
149 | .id = I2C_HW_B_LP, | ||
150 | .name = "Parallel port adapter", | ||
151 | }; | ||
152 | |||
153 | static void i2c_parport_attach (struct parport *port) | 146 | static void i2c_parport_attach (struct parport *port) |
154 | { | 147 | { |
155 | struct i2c_par *adapter; | 148 | struct i2c_par *adapter; |
@@ -169,7 +162,11 @@ static void i2c_parport_attach (struct parport *port) | |||
169 | } | 162 | } |
170 | 163 | ||
171 | /* Fill the rest of the structure */ | 164 | /* Fill the rest of the structure */ |
172 | adapter->adapter = parport_adapter; | 165 | adapter->adapter.owner = THIS_MODULE; |
166 | adapter->adapter.class = I2C_CLASS_HWMON; | ||
167 | adapter->adapter.id = I2C_HW_B_LP; | ||
168 | strlcpy(adapter->adapter.name, "Parallel port adapter", | ||
169 | sizeof(adapter->adapter.name)); | ||
173 | adapter->algo_data = parport_algo_data; | 170 | adapter->algo_data = parport_algo_data; |
174 | if (!adapter_parm[type].getscl.val) | 171 | if (!adapter_parm[type].getscl.val) |
175 | adapter->algo_data.getscl = NULL; | 172 | adapter->algo_data.getscl = NULL; |