Skip to content

Commit c69032a

Browse files
Jean DelvareMauro Carvalho Chehab
Jean Delvare
authored and
Mauro Carvalho Chehab
committed
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: Jean Delvare <[email protected]> Acked-by: Jarod Wilson <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> --- yaml --- svn_rev: 174014 current_ref: refs/heads/rpi-3.12.y current_commit: 43e16ea head_branch: refs/heads/rpi-3.12.y migrated_from: v3
1 parent f846552 commit c69032a

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/rpi-3.12.y: 3c3099d5edd719aebfccf63b628b6f11afa59bfe
2+
refs/heads/rpi-3.12.y: 43e16ea241cab1f4d4206307b2f6eacbaf4dc335

trunk/drivers/media/video/em28xx/em28xx-cards.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,16 +2234,17 @@ static int em28xx_hint_board(struct em28xx *dev)
22342234
/* ----------------------------------------------------------------------- */
22352235
void em28xx_register_i2c_ir(struct em28xx *dev)
22362236
{
2237+
struct i2c_board_info info;
22372238
const unsigned short addr_list[] = {
22382239
0x30, 0x47, I2C_CLIENT_END
22392240
};
22402241

22412242
if (disable_ir)
22422243
return;
22432244

2244-
memset(&dev->info, 0, sizeof(&dev->info));
2245+
memset(&info, 0, sizeof(struct i2c_board_info));
22452246
memset(&dev->init_data, 0, sizeof(dev->init_data));
2246-
strlcpy(dev->info.type, "ir_video", I2C_NAME_SIZE);
2247+
strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
22472248

22482249
/* detect & configure */
22492250
switch (dev->model) {
@@ -2266,8 +2267,8 @@ void em28xx_register_i2c_ir(struct em28xx *dev)
22662267
}
22672268

22682269
if (dev->init_data.name)
2269-
dev->info.platform_data = &dev->init_data;
2270-
i2c_new_probed_device(&dev->i2c_adap, &dev->info, addr_list);
2270+
info.platform_data = &dev->init_data;
2271+
i2c_new_probed_device(&dev->i2c_adap, &info, addr_list);
22712272
}
22722273

22732274
void em28xx_card_setup(struct em28xx *dev)

trunk/drivers/media/video/em28xx/em28xx.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,6 @@ struct em28xx {
615615
struct em28xx_dvb *dvb;
616616

617617
/* I2C keyboard data */
618-
struct i2c_board_info info;
619618
struct IR_i2c_init_data init_data;
620619
};
621620

trunk/drivers/media/video/saa7134/saa7134-input.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ void saa7134_input_fini(struct saa7134_dev *dev)
695695

696696
void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
697697
{
698+
struct i2c_board_info info;
698699
const unsigned short addr_list[] = {
699700
0x7a, 0x47, 0x71, 0x2d,
700701
I2C_CLIENT_END
@@ -714,9 +715,9 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
714715
return;
715716
}
716717

717-
memset(&dev->info, 0, sizeof(dev->info));
718+
memset(&info, 0, sizeof(struct i2c_board_info));
718719
memset(&dev->init_data, 0, sizeof(dev->init_data));
719-
strlcpy(dev->info.type, "ir_video", I2C_NAME_SIZE);
720+
strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
720721

721722
switch (dev->board) {
722723
case SAA7134_BOARD_PINNACLE_PCTV_110i:
@@ -725,11 +726,11 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
725726
if (pinnacle_remote == 0) {
726727
dev->init_data.get_key = get_key_pinnacle_color;
727728
dev->init_data.ir_codes = &ir_codes_pinnacle_color_table;
728-
dev->info.addr = 0x47;
729+
info.addr = 0x47;
729730
} else {
730731
dev->init_data.get_key = get_key_pinnacle_grey;
731732
dev->init_data.ir_codes = &ir_codes_pinnacle_grey_table;
732-
dev->info.addr = 0x47;
733+
info.addr = 0x47;
733734
}
734735
break;
735736
case SAA7134_BOARD_UPMOST_PURPLE_TV:
@@ -741,7 +742,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
741742
dev->init_data.name = "MSI TV@nywhere Plus";
742743
dev->init_data.get_key = get_key_msi_tvanywhere_plus;
743744
dev->init_data.ir_codes = &ir_codes_msi_tvanywhere_plus_table;
744-
dev->info.addr = 0x30;
745+
info.addr = 0x30;
745746
/* MSI TV@nywhere Plus controller doesn't seem to
746747
respond to probes unless we read something from
747748
an existing device. Weird...
@@ -775,20 +776,20 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
775776
break;
776777
case SAA7134_BOARD_AVERMEDIA_CARDBUS_501:
777778
case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
778-
dev->info.addr = 0x40;
779+
info.addr = 0x40;
779780
break;
780781
}
781782

782783
if (dev->init_data.name)
783-
dev->info.platform_data = &dev->init_data;
784+
info.platform_data = &dev->init_data;
784785
/* No need to probe if address is known */
785-
if (dev->info.addr) {
786-
i2c_new_device(&dev->i2c_adap, &dev->info);
786+
if (info.addr) {
787+
i2c_new_device(&dev->i2c_adap, &info);
787788
return;
788789
}
789790

790791
/* Address not known, fallback to probing */
791-
i2c_new_probed_device(&dev->i2c_adap, &dev->info, addr_list);
792+
i2c_new_probed_device(&dev->i2c_adap, &info, addr_list);
792793
}
793794

794795
static int saa7134_rc5_irq(struct saa7134_dev *dev)

trunk/drivers/media/video/saa7134/saa7134.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,6 @@ struct saa7134_dev {
594594
unsigned int insuspend;
595595

596596
/* I2C keyboard data */
597-
struct i2c_board_info info;
598597
struct IR_i2c_init_data init_data;
599598

600599
/* SAA7134_MPEG_* */

0 commit comments

Comments
 (0)