diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-08-12 15:08:54 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-12 16:07:29 -0700 |
commit | 73b7d92f6106e2f55206b8672e5ccf6206689899 (patch) | |
tree | 1be6485d2bc67b4a9b9088022fe32d73d5d8335e /drivers | |
parent | 5ede40f87957c6ededf9284c8339722a97b9dfb6 (diff) | |
download | op-kernel-dev-73b7d92f6106e2f55206b8672e5ccf6206689899.zip op-kernel-dev-73b7d92f6106e2f55206b8672e5ccf6206689899.tar.gz |
matroxfb: i2c structure templates clean-up
Clean up the use of structure templates in i2c-matroxfb. In this case
it's more efficient to initialize the few fields we need individually.
This makes i2c-matroxfb.ko 16% smaller on my system.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: Petr Vandrovec <VANDROVE@vc.cvut.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/matrox/i2c-matroxfb.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/video/matrox/i2c-matroxfb.c b/drivers/video/matrox/i2c-matroxfb.c index 75ee5a1..9478439 100644 --- a/drivers/video/matrox/i2c-matroxfb.c +++ b/drivers/video/matrox/i2c-matroxfb.c @@ -87,13 +87,7 @@ static int matroxfb_gpio_getscl(void* data) { return (matroxfb_read_gpio(b->minfo) & b->mask.clock) ? 1 : 0; } -static struct i2c_adapter matrox_i2c_adapter_template = -{ - .owner = THIS_MODULE, - .id = I2C_HW_B_G400, -}; - -static struct i2c_algo_bit_data matrox_i2c_algo_template = +static const struct i2c_algo_bit_data matrox_i2c_algo_template = { .setsda = matroxfb_gpio_setsda, .setscl = matroxfb_gpio_setscl, @@ -112,7 +106,8 @@ static int i2c_bus_reg(struct i2c_bit_adapter* b, struct matrox_fb_info* minfo, b->minfo = minfo; b->mask.data = data; b->mask.clock = clock; - b->adapter = matrox_i2c_adapter_template; + b->adapter.owner = THIS_MODULE; + b->adapter.id = I2C_HW_B_G400; snprintf(b->adapter.name, sizeof(b->adapter.name), name, minfo->fbcon.node); i2c_set_adapdata(&b->adapter, b); |