Commit 43e16ea2 authored by Jean Delvare's avatar Jean Delvare Committed by Mauro Carvalho Chehab

V4L/DVB (13233): i2c_board_info can be local

Recent fixes to the em28xx and saa7134 drivers have been overzealous.
While the ir-kbd-i2c platform data indeed needs to be persistent, the
struct i2c_board_info doesn't, as it is only used by i2c_new_device().

So revert a part of the original fixes, to save some memory.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Acked-by: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 3c3099d5
...@@ -2234,6 +2234,7 @@ static int em28xx_hint_board(struct em28xx *dev) ...@@ -2234,6 +2234,7 @@ static int em28xx_hint_board(struct em28xx *dev)
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
void em28xx_register_i2c_ir(struct em28xx *dev) void em28xx_register_i2c_ir(struct em28xx *dev)
{ {
struct i2c_board_info info;
const unsigned short addr_list[] = { const unsigned short addr_list[] = {
0x30, 0x47, I2C_CLIENT_END 0x30, 0x47, I2C_CLIENT_END
}; };
...@@ -2241,9 +2242,9 @@ void em28xx_register_i2c_ir(struct em28xx *dev) ...@@ -2241,9 +2242,9 @@ void em28xx_register_i2c_ir(struct em28xx *dev)
if (disable_ir) if (disable_ir)
return; return;
memset(&dev->info, 0, sizeof(&dev->info)); memset(&info, 0, sizeof(struct i2c_board_info));
memset(&dev->init_data, 0, sizeof(dev->init_data)); memset(&dev->init_data, 0, sizeof(dev->init_data));
strlcpy(dev->info.type, "ir_video", I2C_NAME_SIZE); strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
/* detect & configure */ /* detect & configure */
switch (dev->model) { switch (dev->model) {
...@@ -2266,8 +2267,8 @@ void em28xx_register_i2c_ir(struct em28xx *dev) ...@@ -2266,8 +2267,8 @@ void em28xx_register_i2c_ir(struct em28xx *dev)
} }
if (dev->init_data.name) if (dev->init_data.name)
dev->info.platform_data = &dev->init_data; info.platform_data = &dev->init_data;
i2c_new_probed_device(&dev->i2c_adap, &dev->info, addr_list); i2c_new_probed_device(&dev->i2c_adap, &info, addr_list);
} }
void em28xx_card_setup(struct em28xx *dev) void em28xx_card_setup(struct em28xx *dev)
......
...@@ -615,7 +615,6 @@ struct em28xx { ...@@ -615,7 +615,6 @@ struct em28xx {
struct em28xx_dvb *dvb; struct em28xx_dvb *dvb;
/* I2C keyboard data */ /* I2C keyboard data */
struct i2c_board_info info;
struct IR_i2c_init_data init_data; struct IR_i2c_init_data init_data;
}; };
......
...@@ -695,6 +695,7 @@ void saa7134_input_fini(struct saa7134_dev *dev) ...@@ -695,6 +695,7 @@ void saa7134_input_fini(struct saa7134_dev *dev)
void saa7134_probe_i2c_ir(struct saa7134_dev *dev) void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
{ {
struct i2c_board_info info;
const unsigned short addr_list[] = { const unsigned short addr_list[] = {
0x7a, 0x47, 0x71, 0x2d, 0x7a, 0x47, 0x71, 0x2d,
I2C_CLIENT_END I2C_CLIENT_END
...@@ -714,9 +715,9 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) ...@@ -714,9 +715,9 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
return; return;
} }
memset(&dev->info, 0, sizeof(dev->info)); memset(&info, 0, sizeof(struct i2c_board_info));
memset(&dev->init_data, 0, sizeof(dev->init_data)); memset(&dev->init_data, 0, sizeof(dev->init_data));
strlcpy(dev->info.type, "ir_video", I2C_NAME_SIZE); strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
switch (dev->board) { switch (dev->board) {
case SAA7134_BOARD_PINNACLE_PCTV_110i: case SAA7134_BOARD_PINNACLE_PCTV_110i:
...@@ -725,11 +726,11 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) ...@@ -725,11 +726,11 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
if (pinnacle_remote == 0) { if (pinnacle_remote == 0) {
dev->init_data.get_key = get_key_pinnacle_color; dev->init_data.get_key = get_key_pinnacle_color;
dev->init_data.ir_codes = &ir_codes_pinnacle_color_table; dev->init_data.ir_codes = &ir_codes_pinnacle_color_table;
dev->info.addr = 0x47; info.addr = 0x47;
} else { } else {
dev->init_data.get_key = get_key_pinnacle_grey; dev->init_data.get_key = get_key_pinnacle_grey;
dev->init_data.ir_codes = &ir_codes_pinnacle_grey_table; dev->init_data.ir_codes = &ir_codes_pinnacle_grey_table;
dev->info.addr = 0x47; info.addr = 0x47;
} }
break; break;
case SAA7134_BOARD_UPMOST_PURPLE_TV: case SAA7134_BOARD_UPMOST_PURPLE_TV:
...@@ -741,7 +742,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) ...@@ -741,7 +742,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
dev->init_data.name = "MSI TV@nywhere Plus"; dev->init_data.name = "MSI TV@nywhere Plus";
dev->init_data.get_key = get_key_msi_tvanywhere_plus; dev->init_data.get_key = get_key_msi_tvanywhere_plus;
dev->init_data.ir_codes = &ir_codes_msi_tvanywhere_plus_table; dev->init_data.ir_codes = &ir_codes_msi_tvanywhere_plus_table;
dev->info.addr = 0x30; info.addr = 0x30;
/* MSI TV@nywhere Plus controller doesn't seem to /* MSI TV@nywhere Plus controller doesn't seem to
respond to probes unless we read something from respond to probes unless we read something from
an existing device. Weird... an existing device. Weird...
...@@ -775,20 +776,20 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) ...@@ -775,20 +776,20 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
break; break;
case SAA7134_BOARD_AVERMEDIA_CARDBUS_501: case SAA7134_BOARD_AVERMEDIA_CARDBUS_501:
case SAA7134_BOARD_AVERMEDIA_CARDBUS_506: case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
dev->info.addr = 0x40; info.addr = 0x40;
break; break;
} }
if (dev->init_data.name) if (dev->init_data.name)
dev->info.platform_data = &dev->init_data; info.platform_data = &dev->init_data;
/* No need to probe if address is known */ /* No need to probe if address is known */
if (dev->info.addr) { if (info.addr) {
i2c_new_device(&dev->i2c_adap, &dev->info); i2c_new_device(&dev->i2c_adap, &info);
return; return;
} }
/* Address not known, fallback to probing */ /* Address not known, fallback to probing */
i2c_new_probed_device(&dev->i2c_adap, &dev->info, addr_list); i2c_new_probed_device(&dev->i2c_adap, &info, addr_list);
} }
static int saa7134_rc5_irq(struct saa7134_dev *dev) static int saa7134_rc5_irq(struct saa7134_dev *dev)
......
...@@ -594,7 +594,6 @@ struct saa7134_dev { ...@@ -594,7 +594,6 @@ struct saa7134_dev {
unsigned int insuspend; unsigned int insuspend;
/* I2C keyboard data */ /* I2C keyboard data */
struct i2c_board_info info;
struct IR_i2c_init_data init_data; struct IR_i2c_init_data init_data;
/* SAA7134_MPEG_* */ /* SAA7134_MPEG_* */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment