aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-14 13:29:06 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-14 19:26:59 -0400
commited97a6fe5308e5982d118a25f0697b791af5ec50 (patch)
tree3aefde16fcc9edf3c402347fab583eceb1aae44b /drivers/media/usb
parentb24c2b4fb126007e36c5a67461527a5bfed33d17 (diff)
[media] af9033: Don't export functions for the hardware filter
Exporting functions for hardware filter is a bad idea, as it breaks compilation if: CONFIG_DVB_USB_AF9035=y CONFIG_DVB_AF9033=m Because the PID filter function calls would be hardcoded at af9035. The same doesn't happen with af9033_attach() because the dvb_attach() doesn't hardcode it. Instead, it dynamically links it at runtime. However, calling dvb_attach() multiple times is problematic, as it increments module kref. So, the better is to pass one parameter for the af9033 module to fill the hardware filters, and then use it inside af9035. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/dvb-usb-v2/af9035.c10
-rw-r--r--drivers/media/usb/dvb-usb-v2/af9035.h2
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
index 31d09a23c82e..021e4d35e4d7 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -963,7 +963,7 @@ static int af9035_frontend_attach(struct dvb_usb_adapter *adap)
963 963
964 /* attach demodulator */ 964 /* attach demodulator */
965 adap->fe[0] = dvb_attach(af9033_attach, &state->af9033_config[adap->id], 965 adap->fe[0] = dvb_attach(af9033_attach, &state->af9033_config[adap->id],
966 &d->i2c_adap); 966 &d->i2c_adap, &state->ops);
967 if (adap->fe[0] == NULL) { 967 if (adap->fe[0] == NULL) {
968 ret = -ENODEV; 968 ret = -ENODEV;
969 goto err; 969 goto err;
@@ -1373,13 +1373,17 @@ static int af9035_get_stream_config(struct dvb_frontend *fe, u8 *ts_type,
1373 1373
1374static int af9035_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) 1374static int af9035_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff)
1375{ 1375{
1376 return af9033_pid_filter_ctrl(adap->fe[0], onoff); 1376 struct state *state = adap_to_priv(adap);
1377
1378 return state->ops.pid_filter_ctrl(adap->fe[0], onoff);
1377} 1379}
1378 1380
1379static int af9035_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, 1381static int af9035_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid,
1380 int onoff) 1382 int onoff)
1381{ 1383{
1382 return af9033_pid_filter(adap->fe[0], index, pid, onoff); 1384 struct state *state = adap_to_priv(adap);
1385
1386 return state->ops.pid_filter(adap->fe[0], index, pid, onoff);
1383} 1387}
1384 1388
1385static int af9035_probe(struct usb_interface *intf, 1389static int af9035_probe(struct usb_interface *intf,
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.h b/drivers/media/usb/dvb-usb-v2/af9035.h
index a1c68d829b8c..c21902fdd4c4 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.h
+++ b/drivers/media/usb/dvb-usb-v2/af9035.h
@@ -62,6 +62,8 @@ struct state {
62 u8 dual_mode:1; 62 u8 dual_mode:1;
63 u16 eeprom_addr; 63 u16 eeprom_addr;
64 struct af9033_config af9033_config[2]; 64 struct af9033_config af9033_config[2];
65
66 struct af9033_ops ops;
65}; 67};
66 68
67static const u32 clock_lut_af9035[] = { 69static const u32 clock_lut_af9035[] = {