diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-10-30 10:15:53 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-11-03 13:21:29 -0500 |
commit | ed3da2bf2e1800e7c6e31e7d31917dacce599458 (patch) | |
tree | 08ff8590c1407f6acd457b06b08fcf7ca1a25849 | |
parent | 61b103e85a87a5106833fea7b9a21637d9ba2d47 (diff) |
[media] cx23885-dvb: Fix some issues at the DVB error handling
X-Patchwork-Delegate: m.chehab@samsung.com
As pointed by smatch:
drivers/media/pci/cx23885/cx23885-dvb.c:1066 dvb_register() error: we previously assumed 'fe0->dvb.frontend' could be null (see line 1060)
drivers/media/pci/cx23885/cx23885-dvb.c:1990 cx23885_dvb_register() error: we previously assumed 'fe0' could be null (see line 1975)
What happens is that the error handling logic when a frontend
register fails sometimes keep doing the work, as if it didn't
fail.
This could potentially cause an OOPS. So, simplify the logic
a little bit and return an error if frontend fails before
trying to setup VB2 queue.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/pci/cx23885/cx23885-dvb.c | 290 |
1 files changed, 145 insertions, 145 deletions
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c index 5e6caed6e389..9da5cf3cea8c 100644 --- a/drivers/media/pci/cx23885/cx23885-dvb.c +++ b/drivers/media/pci/cx23885/cx23885-dvb.c | |||
@@ -1058,11 +1058,11 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1058 | fe0->dvb.frontend = dvb_attach(s5h1409_attach, | 1058 | fe0->dvb.frontend = dvb_attach(s5h1409_attach, |
1059 | &hauppauge_generic_config, | 1059 | &hauppauge_generic_config, |
1060 | &i2c_bus->i2c_adap); | 1060 | &i2c_bus->i2c_adap); |
1061 | if (fe0->dvb.frontend != NULL) { | 1061 | if (fe0->dvb.frontend == NULL) |
1062 | dvb_attach(mt2131_attach, fe0->dvb.frontend, | 1062 | break; |
1063 | &i2c_bus->i2c_adap, | 1063 | dvb_attach(mt2131_attach, fe0->dvb.frontend, |
1064 | &hauppauge_generic_tunerconfig, 0); | 1064 | &i2c_bus->i2c_adap, |
1065 | } | 1065 | &hauppauge_generic_tunerconfig, 0); |
1066 | break; | 1066 | break; |
1067 | case CX23885_BOARD_HAUPPAUGE_HVR1270: | 1067 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
1068 | case CX23885_BOARD_HAUPPAUGE_HVR1275: | 1068 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
@@ -1070,11 +1070,11 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1070 | fe0->dvb.frontend = dvb_attach(lgdt3305_attach, | 1070 | fe0->dvb.frontend = dvb_attach(lgdt3305_attach, |
1071 | &hauppauge_lgdt3305_config, | 1071 | &hauppauge_lgdt3305_config, |
1072 | &i2c_bus->i2c_adap); | 1072 | &i2c_bus->i2c_adap); |
1073 | if (fe0->dvb.frontend != NULL) { | 1073 | if (fe0->dvb.frontend == NULL) |
1074 | dvb_attach(tda18271_attach, fe0->dvb.frontend, | 1074 | break; |
1075 | 0x60, &dev->i2c_bus[1].i2c_adap, | 1075 | dvb_attach(tda18271_attach, fe0->dvb.frontend, |
1076 | &hauppauge_hvr127x_config); | 1076 | 0x60, &dev->i2c_bus[1].i2c_adap, |
1077 | } | 1077 | &hauppauge_hvr127x_config); |
1078 | if (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1275) | 1078 | if (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1275) |
1079 | cx23885_set_frontend_hook(port, fe0->dvb.frontend); | 1079 | cx23885_set_frontend_hook(port, fe0->dvb.frontend); |
1080 | break; | 1080 | break; |
@@ -1084,11 +1084,12 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1084 | fe0->dvb.frontend = dvb_attach(s5h1411_attach, | 1084 | fe0->dvb.frontend = dvb_attach(s5h1411_attach, |
1085 | &hcw_s5h1411_config, | 1085 | &hcw_s5h1411_config, |
1086 | &i2c_bus->i2c_adap); | 1086 | &i2c_bus->i2c_adap); |
1087 | if (fe0->dvb.frontend != NULL) { | 1087 | if (fe0->dvb.frontend == NULL) |
1088 | dvb_attach(tda18271_attach, fe0->dvb.frontend, | 1088 | break; |
1089 | 0x60, &dev->i2c_bus[1].i2c_adap, | 1089 | |
1090 | &hauppauge_tda18271_config); | 1090 | dvb_attach(tda18271_attach, fe0->dvb.frontend, |
1091 | } | 1091 | 0x60, &dev->i2c_bus[1].i2c_adap, |
1092 | &hauppauge_tda18271_config); | ||
1092 | 1093 | ||
1093 | tda18271_attach(&dev->ts1.analog_fe, | 1094 | tda18271_attach(&dev->ts1.analog_fe, |
1094 | 0x60, &dev->i2c_bus[1].i2c_adap, | 1095 | 0x60, &dev->i2c_bus[1].i2c_adap, |
@@ -1103,14 +1104,15 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1103 | dvb_attach(s5h1409_attach, | 1104 | dvb_attach(s5h1409_attach, |
1104 | &hauppauge_ezqam_config, | 1105 | &hauppauge_ezqam_config, |
1105 | &i2c_bus->i2c_adap); | 1106 | &i2c_bus->i2c_adap); |
1106 | if (fe0->dvb.frontend != NULL) { | 1107 | if (fe0->dvb.frontend == NULL) |
1107 | dvb_attach(tda829x_attach, fe0->dvb.frontend, | 1108 | break; |
1108 | &dev->i2c_bus[1].i2c_adap, 0x42, | 1109 | |
1109 | &tda829x_no_probe); | 1110 | dvb_attach(tda829x_attach, fe0->dvb.frontend, |
1110 | dvb_attach(tda18271_attach, fe0->dvb.frontend, | 1111 | &dev->i2c_bus[1].i2c_adap, 0x42, |
1111 | 0x60, &dev->i2c_bus[1].i2c_adap, | 1112 | &tda829x_no_probe); |
1112 | &hauppauge_tda18271_config); | 1113 | dvb_attach(tda18271_attach, fe0->dvb.frontend, |
1113 | } | 1114 | 0x60, &dev->i2c_bus[1].i2c_adap, |
1115 | &hauppauge_tda18271_config); | ||
1114 | break; | 1116 | break; |
1115 | case 0: | 1117 | case 0: |
1116 | default: | 1118 | default: |
@@ -1118,11 +1120,11 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1118 | dvb_attach(s5h1409_attach, | 1120 | dvb_attach(s5h1409_attach, |
1119 | &hauppauge_generic_config, | 1121 | &hauppauge_generic_config, |
1120 | &i2c_bus->i2c_adap); | 1122 | &i2c_bus->i2c_adap); |
1121 | if (fe0->dvb.frontend != NULL) | 1123 | if (fe0->dvb.frontend == NULL) |
1122 | dvb_attach(mt2131_attach, fe0->dvb.frontend, | 1124 | break; |
1123 | &i2c_bus->i2c_adap, | 1125 | dvb_attach(mt2131_attach, fe0->dvb.frontend, |
1124 | &hauppauge_generic_tunerconfig, 0); | 1126 | &i2c_bus->i2c_adap, |
1125 | break; | 1127 | &hauppauge_generic_tunerconfig, 0); |
1126 | } | 1128 | } |
1127 | break; | 1129 | break; |
1128 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: | 1130 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: |
@@ -1130,32 +1132,33 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1130 | fe0->dvb.frontend = dvb_attach(s5h1409_attach, | 1132 | fe0->dvb.frontend = dvb_attach(s5h1409_attach, |
1131 | &hauppauge_hvr1800lp_config, | 1133 | &hauppauge_hvr1800lp_config, |
1132 | &i2c_bus->i2c_adap); | 1134 | &i2c_bus->i2c_adap); |
1133 | if (fe0->dvb.frontend != NULL) { | 1135 | if (fe0->dvb.frontend == NULL) |
1134 | dvb_attach(mt2131_attach, fe0->dvb.frontend, | 1136 | break; |
1135 | &i2c_bus->i2c_adap, | 1137 | dvb_attach(mt2131_attach, fe0->dvb.frontend, |
1136 | &hauppauge_generic_tunerconfig, 0); | 1138 | &i2c_bus->i2c_adap, |
1137 | } | 1139 | &hauppauge_generic_tunerconfig, 0); |
1138 | break; | 1140 | break; |
1139 | case CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP: | 1141 | case CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP: |
1140 | i2c_bus = &dev->i2c_bus[0]; | 1142 | i2c_bus = &dev->i2c_bus[0]; |
1141 | fe0->dvb.frontend = dvb_attach(lgdt330x_attach, | 1143 | fe0->dvb.frontend = dvb_attach(lgdt330x_attach, |
1142 | &fusionhdtv_5_express, | 1144 | &fusionhdtv_5_express, |
1143 | &i2c_bus->i2c_adap); | 1145 | &i2c_bus->i2c_adap); |
1144 | if (fe0->dvb.frontend != NULL) { | 1146 | if (fe0->dvb.frontend == NULL) |
1145 | dvb_attach(simple_tuner_attach, fe0->dvb.frontend, | 1147 | break; |
1146 | &i2c_bus->i2c_adap, 0x61, | 1148 | dvb_attach(simple_tuner_attach, fe0->dvb.frontend, |
1147 | TUNER_LG_TDVS_H06XF); | 1149 | &i2c_bus->i2c_adap, 0x61, |
1148 | } | 1150 | TUNER_LG_TDVS_H06XF); |
1149 | break; | 1151 | break; |
1150 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: | 1152 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: |
1151 | i2c_bus = &dev->i2c_bus[1]; | 1153 | i2c_bus = &dev->i2c_bus[1]; |
1152 | fe0->dvb.frontend = dvb_attach(s5h1409_attach, | 1154 | fe0->dvb.frontend = dvb_attach(s5h1409_attach, |
1153 | &hauppauge_hvr1500q_config, | 1155 | &hauppauge_hvr1500q_config, |
1154 | &dev->i2c_bus[0].i2c_adap); | 1156 | &dev->i2c_bus[0].i2c_adap); |
1155 | if (fe0->dvb.frontend != NULL) | 1157 | if (fe0->dvb.frontend == NULL) |
1156 | dvb_attach(xc5000_attach, fe0->dvb.frontend, | 1158 | break; |
1157 | &i2c_bus->i2c_adap, | 1159 | dvb_attach(xc5000_attach, fe0->dvb.frontend, |
1158 | &hauppauge_hvr1500q_tunerconfig); | 1160 | &i2c_bus->i2c_adap, |
1161 | &hauppauge_hvr1500q_tunerconfig); | ||
1159 | break; | 1162 | break; |
1160 | case CX23885_BOARD_HAUPPAUGE_HVR1500: | 1163 | case CX23885_BOARD_HAUPPAUGE_HVR1500: |
1161 | i2c_bus = &dev->i2c_bus[1]; | 1164 | i2c_bus = &dev->i2c_bus[1]; |
@@ -1186,14 +1189,14 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1186 | fe0->dvb.frontend = dvb_attach(tda10048_attach, | 1189 | fe0->dvb.frontend = dvb_attach(tda10048_attach, |
1187 | &hauppauge_hvr1200_config, | 1190 | &hauppauge_hvr1200_config, |
1188 | &i2c_bus->i2c_adap); | 1191 | &i2c_bus->i2c_adap); |
1189 | if (fe0->dvb.frontend != NULL) { | 1192 | if (fe0->dvb.frontend == NULL) |
1190 | dvb_attach(tda829x_attach, fe0->dvb.frontend, | 1193 | break; |
1191 | &dev->i2c_bus[1].i2c_adap, 0x42, | 1194 | dvb_attach(tda829x_attach, fe0->dvb.frontend, |
1192 | &tda829x_no_probe); | 1195 | &dev->i2c_bus[1].i2c_adap, 0x42, |
1193 | dvb_attach(tda18271_attach, fe0->dvb.frontend, | 1196 | &tda829x_no_probe); |
1194 | 0x60, &dev->i2c_bus[1].i2c_adap, | 1197 | dvb_attach(tda18271_attach, fe0->dvb.frontend, |
1195 | &hauppauge_hvr1200_tuner_config); | 1198 | 0x60, &dev->i2c_bus[1].i2c_adap, |
1196 | } | 1199 | &hauppauge_hvr1200_tuner_config); |
1197 | break; | 1200 | break; |
1198 | case CX23885_BOARD_HAUPPAUGE_HVR1210: | 1201 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
1199 | i2c_bus = &dev->i2c_bus[0]; | 1202 | i2c_bus = &dev->i2c_bus[0]; |
@@ -1452,12 +1455,10 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1452 | fe0->dvb.frontend = dvb_attach(lgs8gxx_attach, | 1455 | fe0->dvb.frontend = dvb_attach(lgs8gxx_attach, |
1453 | &mygica_x8506_lgs8gl5_config, | 1456 | &mygica_x8506_lgs8gl5_config, |
1454 | &i2c_bus->i2c_adap); | 1457 | &i2c_bus->i2c_adap); |
1455 | if (fe0->dvb.frontend != NULL) { | 1458 | if (fe0->dvb.frontend == NULL) |
1456 | dvb_attach(xc5000_attach, | 1459 | break; |
1457 | fe0->dvb.frontend, | 1460 | dvb_attach(xc5000_attach, fe0->dvb.frontend, |
1458 | &i2c_bus2->i2c_adap, | 1461 | &i2c_bus2->i2c_adap, &mygica_x8506_xc5000_config); |
1459 | &mygica_x8506_xc5000_config); | ||
1460 | } | ||
1461 | cx23885_set_frontend_hook(port, fe0->dvb.frontend); | 1462 | cx23885_set_frontend_hook(port, fe0->dvb.frontend); |
1462 | break; | 1463 | break; |
1463 | case CX23885_BOARD_MYGICA_X8507: | 1464 | case CX23885_BOARD_MYGICA_X8507: |
@@ -1466,12 +1467,12 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1466 | fe0->dvb.frontend = dvb_attach(mb86a20s_attach, | 1467 | fe0->dvb.frontend = dvb_attach(mb86a20s_attach, |
1467 | &mygica_x8507_mb86a20s_config, | 1468 | &mygica_x8507_mb86a20s_config, |
1468 | &i2c_bus->i2c_adap); | 1469 | &i2c_bus->i2c_adap); |
1469 | if (fe0->dvb.frontend != NULL) { | 1470 | if (fe0->dvb.frontend == NULL) |
1470 | dvb_attach(xc5000_attach, | 1471 | break; |
1471 | fe0->dvb.frontend, | 1472 | |
1472 | &i2c_bus2->i2c_adap, | 1473 | dvb_attach(xc5000_attach, fe0->dvb.frontend, |
1473 | &mygica_x8507_xc5000_config); | 1474 | &i2c_bus2->i2c_adap, |
1474 | } | 1475 | &mygica_x8507_xc5000_config); |
1475 | cx23885_set_frontend_hook(port, fe0->dvb.frontend); | 1476 | cx23885_set_frontend_hook(port, fe0->dvb.frontend); |
1476 | break; | 1477 | break; |
1477 | case CX23885_BOARD_MAGICPRO_PROHDTVE2: | 1478 | case CX23885_BOARD_MAGICPRO_PROHDTVE2: |
@@ -1480,12 +1481,11 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1480 | fe0->dvb.frontend = dvb_attach(lgs8gxx_attach, | 1481 | fe0->dvb.frontend = dvb_attach(lgs8gxx_attach, |
1481 | &magicpro_prohdtve2_lgs8g75_config, | 1482 | &magicpro_prohdtve2_lgs8g75_config, |
1482 | &i2c_bus->i2c_adap); | 1483 | &i2c_bus->i2c_adap); |
1483 | if (fe0->dvb.frontend != NULL) { | 1484 | if (fe0->dvb.frontend == NULL) |
1484 | dvb_attach(xc5000_attach, | 1485 | break; |
1485 | fe0->dvb.frontend, | 1486 | dvb_attach(xc5000_attach, fe0->dvb.frontend, |
1486 | &i2c_bus2->i2c_adap, | 1487 | &i2c_bus2->i2c_adap, |
1487 | &magicpro_prohdtve2_xc5000_config); | 1488 | &magicpro_prohdtve2_xc5000_config); |
1488 | } | ||
1489 | cx23885_set_frontend_hook(port, fe0->dvb.frontend); | 1489 | cx23885_set_frontend_hook(port, fe0->dvb.frontend); |
1490 | break; | 1490 | break; |
1491 | case CX23885_BOARD_HAUPPAUGE_HVR1850: | 1491 | case CX23885_BOARD_HAUPPAUGE_HVR1850: |
@@ -1493,10 +1493,11 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1493 | fe0->dvb.frontend = dvb_attach(s5h1411_attach, | 1493 | fe0->dvb.frontend = dvb_attach(s5h1411_attach, |
1494 | &hcw_s5h1411_config, | 1494 | &hcw_s5h1411_config, |
1495 | &i2c_bus->i2c_adap); | 1495 | &i2c_bus->i2c_adap); |
1496 | if (fe0->dvb.frontend != NULL) | 1496 | if (fe0->dvb.frontend == NULL) |
1497 | dvb_attach(tda18271_attach, fe0->dvb.frontend, | 1497 | break; |
1498 | 0x60, &dev->i2c_bus[0].i2c_adap, | 1498 | dvb_attach(tda18271_attach, fe0->dvb.frontend, |
1499 | &hauppauge_tda18271_config); | 1499 | 0x60, &dev->i2c_bus[0].i2c_adap, |
1500 | &hauppauge_tda18271_config); | ||
1500 | 1501 | ||
1501 | tda18271_attach(&dev->ts1.analog_fe, | 1502 | tda18271_attach(&dev->ts1.analog_fe, |
1502 | 0x60, &dev->i2c_bus[1].i2c_adap, | 1503 | 0x60, &dev->i2c_bus[1].i2c_adap, |
@@ -1508,10 +1509,11 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1508 | fe0->dvb.frontend = dvb_attach(s5h1411_attach, | 1509 | fe0->dvb.frontend = dvb_attach(s5h1411_attach, |
1509 | &hcw_s5h1411_config, | 1510 | &hcw_s5h1411_config, |
1510 | &i2c_bus->i2c_adap); | 1511 | &i2c_bus->i2c_adap); |
1511 | if (fe0->dvb.frontend != NULL) | 1512 | if (fe0->dvb.frontend == NULL) |
1512 | dvb_attach(tda18271_attach, fe0->dvb.frontend, | 1513 | break; |
1513 | 0x60, &dev->i2c_bus[0].i2c_adap, | 1514 | dvb_attach(tda18271_attach, fe0->dvb.frontend, |
1514 | &hauppauge_tda18271_config); | 1515 | 0x60, &dev->i2c_bus[0].i2c_adap, |
1516 | &hauppauge_tda18271_config); | ||
1515 | break; | 1517 | break; |
1516 | case CX23885_BOARD_MYGICA_X8558PRO: | 1518 | case CX23885_BOARD_MYGICA_X8558PRO: |
1517 | switch (port->nr) { | 1519 | switch (port->nr) { |
@@ -1521,12 +1523,11 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1521 | fe0->dvb.frontend = dvb_attach(atbm8830_attach, | 1523 | fe0->dvb.frontend = dvb_attach(atbm8830_attach, |
1522 | &mygica_x8558pro_atbm8830_cfg1, | 1524 | &mygica_x8558pro_atbm8830_cfg1, |
1523 | &i2c_bus->i2c_adap); | 1525 | &i2c_bus->i2c_adap); |
1524 | if (fe0->dvb.frontend != NULL) { | 1526 | if (fe0->dvb.frontend == NULL) |
1525 | dvb_attach(max2165_attach, | 1527 | break; |
1526 | fe0->dvb.frontend, | 1528 | dvb_attach(max2165_attach, fe0->dvb.frontend, |
1527 | &i2c_bus->i2c_adap, | 1529 | &i2c_bus->i2c_adap, |
1528 | &mygic_x8558pro_max2165_cfg1); | 1530 | &mygic_x8558pro_max2165_cfg1); |
1529 | } | ||
1530 | break; | 1531 | break; |
1531 | /* port C */ | 1532 | /* port C */ |
1532 | case 2: | 1533 | case 2: |
@@ -1534,13 +1535,11 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1534 | fe0->dvb.frontend = dvb_attach(atbm8830_attach, | 1535 | fe0->dvb.frontend = dvb_attach(atbm8830_attach, |
1535 | &mygica_x8558pro_atbm8830_cfg2, | 1536 | &mygica_x8558pro_atbm8830_cfg2, |
1536 | &i2c_bus->i2c_adap); | 1537 | &i2c_bus->i2c_adap); |
1537 | if (fe0->dvb.frontend != NULL) { | 1538 | if (fe0->dvb.frontend == NULL) |
1538 | dvb_attach(max2165_attach, | 1539 | break; |
1539 | fe0->dvb.frontend, | 1540 | dvb_attach(max2165_attach, fe0->dvb.frontend, |
1540 | &i2c_bus->i2c_adap, | 1541 | &i2c_bus->i2c_adap, |
1541 | &mygic_x8558pro_max2165_cfg2); | 1542 | &mygic_x8558pro_max2165_cfg2); |
1542 | } | ||
1543 | break; | ||
1544 | } | 1543 | } |
1545 | break; | 1544 | break; |
1546 | case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF: | 1545 | case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF: |
@@ -1552,15 +1551,15 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1552 | fe0->dvb.frontend = dvb_attach(stv0367ter_attach, | 1551 | fe0->dvb.frontend = dvb_attach(stv0367ter_attach, |
1553 | &netup_stv0367_config[port->nr - 1], | 1552 | &netup_stv0367_config[port->nr - 1], |
1554 | &i2c_bus->i2c_adap); | 1553 | &i2c_bus->i2c_adap); |
1555 | if (fe0->dvb.frontend != NULL) { | 1554 | if (fe0->dvb.frontend == NULL) |
1556 | if (NULL == dvb_attach(xc5000_attach, | 1555 | break; |
1557 | fe0->dvb.frontend, | 1556 | if (NULL == dvb_attach(xc5000_attach, fe0->dvb.frontend, |
1558 | &i2c_bus->i2c_adap, | 1557 | &i2c_bus->i2c_adap, |
1559 | &netup_xc5000_config[port->nr - 1])) | 1558 | &netup_xc5000_config[port->nr - 1])) |
1560 | goto frontend_detach; | 1559 | goto frontend_detach; |
1561 | /* load xc5000 firmware */ | 1560 | /* load xc5000 firmware */ |
1562 | fe0->dvb.frontend->ops.tuner_ops.init(fe0->dvb.frontend); | 1561 | fe0->dvb.frontend->ops.tuner_ops.init(fe0->dvb.frontend); |
1563 | } | 1562 | |
1564 | /* MFE frontend 2 */ | 1563 | /* MFE frontend 2 */ |
1565 | fe1 = vb2_dvb_get_frontend(&port->frontends, 2); | 1564 | fe1 = vb2_dvb_get_frontend(&port->frontends, 2); |
1566 | if (fe1 == NULL) | 1565 | if (fe1 == NULL) |
@@ -1569,14 +1568,15 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1569 | fe1->dvb.frontend = dvb_attach(stv0367cab_attach, | 1568 | fe1->dvb.frontend = dvb_attach(stv0367cab_attach, |
1570 | &netup_stv0367_config[port->nr - 1], | 1569 | &netup_stv0367_config[port->nr - 1], |
1571 | &i2c_bus->i2c_adap); | 1570 | &i2c_bus->i2c_adap); |
1572 | if (fe1->dvb.frontend != NULL) { | 1571 | if (fe1->dvb.frontend == NULL) |
1573 | fe1->dvb.frontend->id = 1; | 1572 | break; |
1574 | if (NULL == dvb_attach(xc5000_attach, | 1573 | |
1575 | fe1->dvb.frontend, | 1574 | fe1->dvb.frontend->id = 1; |
1576 | &i2c_bus->i2c_adap, | 1575 | if (NULL == dvb_attach(xc5000_attach, |
1577 | &netup_xc5000_config[port->nr - 1])) | 1576 | fe1->dvb.frontend, |
1578 | goto frontend_detach; | 1577 | &i2c_bus->i2c_adap, |
1579 | } | 1578 | &netup_xc5000_config[port->nr - 1])) |
1579 | goto frontend_detach; | ||
1580 | break; | 1580 | break; |
1581 | case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL: | 1581 | case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL: |
1582 | i2c_bus = &dev->i2c_bus[0]; | 1582 | i2c_bus = &dev->i2c_bus[0]; |
@@ -1588,26 +1588,26 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1588 | fe0->dvb.frontend = dvb_attach(drxk_attach, | 1588 | fe0->dvb.frontend = dvb_attach(drxk_attach, |
1589 | &terratec_drxk_config[0], | 1589 | &terratec_drxk_config[0], |
1590 | &i2c_bus->i2c_adap); | 1590 | &i2c_bus->i2c_adap); |
1591 | if (fe0->dvb.frontend != NULL) { | 1591 | if (fe0->dvb.frontend == NULL) |
1592 | if (!dvb_attach(mt2063_attach, | 1592 | break; |
1593 | fe0->dvb.frontend, | 1593 | if (!dvb_attach(mt2063_attach, |
1594 | &terratec_mt2063_config[0], | 1594 | fe0->dvb.frontend, |
1595 | &i2c_bus2->i2c_adap)) | 1595 | &terratec_mt2063_config[0], |
1596 | goto frontend_detach; | 1596 | &i2c_bus2->i2c_adap)) |
1597 | } | 1597 | goto frontend_detach; |
1598 | break; | 1598 | break; |
1599 | /* port c */ | 1599 | /* port c */ |
1600 | case 2: | 1600 | case 2: |
1601 | fe0->dvb.frontend = dvb_attach(drxk_attach, | 1601 | fe0->dvb.frontend = dvb_attach(drxk_attach, |
1602 | &terratec_drxk_config[1], | 1602 | &terratec_drxk_config[1], |
1603 | &i2c_bus->i2c_adap); | 1603 | &i2c_bus->i2c_adap); |
1604 | if (fe0->dvb.frontend != NULL) { | 1604 | if (fe0->dvb.frontend == NULL) |
1605 | if (!dvb_attach(mt2063_attach, | 1605 | break; |
1606 | fe0->dvb.frontend, | 1606 | if (!dvb_attach(mt2063_attach, |
1607 | &terratec_mt2063_config[1], | 1607 | fe0->dvb.frontend, |
1608 | &i2c_bus2->i2c_adap)) | 1608 | &terratec_mt2063_config[1], |
1609 | goto frontend_detach; | 1609 | &i2c_bus2->i2c_adap)) |
1610 | } | 1610 | goto frontend_detach; |
1611 | break; | 1611 | break; |
1612 | } | 1612 | } |
1613 | break; | 1613 | break; |
@@ -1617,10 +1617,10 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1617 | fe0->dvb.frontend = dvb_attach(ds3000_attach, | 1617 | fe0->dvb.frontend = dvb_attach(ds3000_attach, |
1618 | &tevii_ds3000_config, | 1618 | &tevii_ds3000_config, |
1619 | &i2c_bus->i2c_adap); | 1619 | &i2c_bus->i2c_adap); |
1620 | if (fe0->dvb.frontend != NULL) { | 1620 | if (fe0->dvb.frontend == NULL) |
1621 | dvb_attach(ts2020_attach, fe0->dvb.frontend, | 1621 | break; |
1622 | &tevii_ts2020_config, &i2c_bus->i2c_adap); | 1622 | dvb_attach(ts2020_attach, fe0->dvb.frontend, |
1623 | } | 1623 | &tevii_ts2020_config, &i2c_bus->i2c_adap); |
1624 | break; | 1624 | break; |
1625 | case CX23885_BOARD_PROF_8000: | 1625 | case CX23885_BOARD_PROF_8000: |
1626 | i2c_bus = &dev->i2c_bus[0]; | 1626 | i2c_bus = &dev->i2c_bus[0]; |
@@ -1629,15 +1629,15 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1629 | &prof_8000_stv090x_config, | 1629 | &prof_8000_stv090x_config, |
1630 | &i2c_bus->i2c_adap, | 1630 | &i2c_bus->i2c_adap, |
1631 | STV090x_DEMODULATOR_0); | 1631 | STV090x_DEMODULATOR_0); |
1632 | if (fe0->dvb.frontend != NULL) { | 1632 | if (fe0->dvb.frontend == NULL) |
1633 | if (!dvb_attach(stb6100_attach, | 1633 | break; |
1634 | fe0->dvb.frontend, | 1634 | if (!dvb_attach(stb6100_attach, |
1635 | &prof_8000_stb6100_config, | 1635 | fe0->dvb.frontend, |
1636 | &i2c_bus->i2c_adap)) | 1636 | &prof_8000_stb6100_config, |
1637 | goto frontend_detach; | 1637 | &i2c_bus->i2c_adap)) |
1638 | goto frontend_detach; | ||
1638 | 1639 | ||
1639 | fe0->dvb.frontend->ops.set_voltage = p8000_set_voltage; | 1640 | fe0->dvb.frontend->ops.set_voltage = p8000_set_voltage; |
1640 | } | ||
1641 | break; | 1641 | break; |
1642 | case CX23885_BOARD_HAUPPAUGE_HVR4400: | 1642 | case CX23885_BOARD_HAUPPAUGE_HVR4400: |
1643 | i2c_bus = &dev->i2c_bus[0]; | 1643 | i2c_bus = &dev->i2c_bus[0]; |
@@ -1648,26 +1648,26 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1648 | fe0->dvb.frontend = dvb_attach(tda10071_attach, | 1648 | fe0->dvb.frontend = dvb_attach(tda10071_attach, |
1649 | &hauppauge_tda10071_config, | 1649 | &hauppauge_tda10071_config, |
1650 | &i2c_bus->i2c_adap); | 1650 | &i2c_bus->i2c_adap); |
1651 | if (fe0->dvb.frontend != NULL) { | 1651 | if (fe0->dvb.frontend == NULL) |
1652 | if (!dvb_attach(a8293_attach, fe0->dvb.frontend, | 1652 | break; |
1653 | &i2c_bus->i2c_adap, | 1653 | if (!dvb_attach(a8293_attach, fe0->dvb.frontend, |
1654 | &hauppauge_a8293_config)) | 1654 | &i2c_bus->i2c_adap, |
1655 | goto frontend_detach; | 1655 | &hauppauge_a8293_config)) |
1656 | } | 1656 | goto frontend_detach; |
1657 | break; | 1657 | break; |
1658 | /* port c */ | 1658 | /* port c */ |
1659 | case 2: | 1659 | case 2: |
1660 | fe0->dvb.frontend = dvb_attach(si2165_attach, | 1660 | fe0->dvb.frontend = dvb_attach(si2165_attach, |
1661 | &hauppauge_hvr4400_si2165_config, | 1661 | &hauppauge_hvr4400_si2165_config, |
1662 | &i2c_bus->i2c_adap); | 1662 | &i2c_bus->i2c_adap); |
1663 | if (fe0->dvb.frontend != NULL) { | 1663 | if (fe0->dvb.frontend == NULL) |
1664 | fe0->dvb.frontend->ops.i2c_gate_ctrl = NULL; | 1664 | break; |
1665 | if (!dvb_attach(tda18271_attach, | 1665 | fe0->dvb.frontend->ops.i2c_gate_ctrl = NULL; |
1666 | fe0->dvb.frontend, | 1666 | if (!dvb_attach(tda18271_attach, |
1667 | 0x60, &i2c_bus2->i2c_adap, | 1667 | fe0->dvb.frontend, |
1668 | &hauppauge_hvr4400_tuner_config)) | 1668 | 0x60, &i2c_bus2->i2c_adap, |
1669 | goto frontend_detach; | 1669 | &hauppauge_hvr4400_tuner_config)) |
1670 | } | 1670 | goto frontend_detach; |
1671 | break; | 1671 | break; |
1672 | } | 1672 | } |
1673 | break; | 1673 | break; |
@@ -2032,7 +2032,7 @@ int cx23885_dvb_register(struct cx23885_tsport *port) | |||
2032 | 2032 | ||
2033 | fe0 = vb2_dvb_get_frontend(&port->frontends, i); | 2033 | fe0 = vb2_dvb_get_frontend(&port->frontends, i); |
2034 | if (!fe0) | 2034 | if (!fe0) |
2035 | err = -EINVAL; | 2035 | return -EINVAL; |
2036 | 2036 | ||
2037 | dprintk(1, "%s\n", __func__); | 2037 | dprintk(1, "%s\n", __func__); |
2038 | dprintk(1, " ->probed by Card=%d Name=%s, PCI %02x:%02x\n", | 2038 | dprintk(1, " ->probed by Card=%d Name=%s, PCI %02x:%02x\n", |