diff options
author | Antti Palosaari <crope@iki.fi> | 2012-06-12 00:05:20 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-08-04 06:56:30 -0400 |
commit | 2d2b37c75a4f5eb919c10674a8c2f0f5a3ac40ec (patch) | |
tree | 6a976666df721db7b6b66432edfbd319d9f5367c /drivers/media/dvb | |
parent | b00a901801f671a48feac6048faeafe0979760e6 (diff) |
[media] dvb_usb_v2: move few callbacks one level up
Move frontend_attach, tuner_attach, frontend_ctrl and streaming_ctrl
from adapter to device.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-usb/af9015.c | 12 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb_usb.h | 9 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb_usb_dvb.c | 24 |
3 files changed, 20 insertions, 25 deletions
diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c index 9d0bd9bed739..73ff4bbb89ce 100644 --- a/drivers/media/dvb/dvb-usb/af9015.c +++ b/drivers/media/dvb/dvb-usb/af9015.c | |||
@@ -1319,8 +1319,10 @@ static struct dvb_usb_device_properties af9015_props = { | |||
1319 | .firmware = "dvb-usb-af9015.fw", | 1319 | .firmware = "dvb-usb-af9015.fw", |
1320 | .download_firmware = af9015_download_firmware, | 1320 | .download_firmware = af9015_download_firmware, |
1321 | 1321 | ||
1322 | .read_config = af9015_read_config, | ||
1323 | .i2c_algo = &af9015_i2c_algo, | 1322 | .i2c_algo = &af9015_i2c_algo, |
1323 | .read_config = af9015_read_config, | ||
1324 | .frontend_attach = af9015_af9013_frontend_attach, | ||
1325 | .tuner_attach = af9015_tuner_attach, | ||
1324 | .init = af9015_init, | 1326 | .init = af9015_init, |
1325 | .get_rc_config = af9015_get_rc_config, | 1327 | .get_rc_config = af9015_get_rc_config, |
1326 | .get_usb_stream_config = af9015_get_usb_stream_config, | 1328 | .get_usb_stream_config = af9015_get_usb_stream_config, |
@@ -1333,13 +1335,7 @@ static struct dvb_usb_device_properties af9015_props = { | |||
1333 | .pid_filter_count = 32, | 1335 | .pid_filter_count = 32, |
1334 | .pid_filter = af9015_pid_filter, | 1336 | .pid_filter = af9015_pid_filter, |
1335 | .pid_filter_ctrl = af9015_pid_filter_ctrl, | 1337 | .pid_filter_ctrl = af9015_pid_filter_ctrl, |
1336 | .frontend_attach = af9015_af9013_frontend_attach, | ||
1337 | .tuner_attach = af9015_tuner_attach, | ||
1338 | }, | 1338 | }, |
1339 | { | ||
1340 | .frontend_attach = af9015_af9013_frontend_attach, | ||
1341 | .tuner_attach = af9015_tuner_attach, | ||
1342 | } | ||
1343 | }, | 1339 | }, |
1344 | }; | 1340 | }; |
1345 | 1341 | ||
@@ -1427,9 +1423,9 @@ MODULE_DEVICE_TABLE(usb, af9015_id_table); | |||
1427 | /* usb specific object needed to register this driver with the usb subsystem */ | 1423 | /* usb specific object needed to register this driver with the usb subsystem */ |
1428 | static struct usb_driver af9015_usb_driver = { | 1424 | static struct usb_driver af9015_usb_driver = { |
1429 | .name = KBUILD_MODNAME, | 1425 | .name = KBUILD_MODNAME, |
1426 | .id_table = af9015_id_table, | ||
1430 | .probe = dvb_usbv2_probe, | 1427 | .probe = dvb_usbv2_probe, |
1431 | .disconnect = dvb_usbv2_disconnect, | 1428 | .disconnect = dvb_usbv2_disconnect, |
1432 | .id_table = af9015_id_table, | ||
1433 | .no_dynamic_id = 1, | 1429 | .no_dynamic_id = 1, |
1434 | .soft_unbind = 1, | 1430 | .soft_unbind = 1, |
1435 | }; | 1431 | }; |
diff --git a/drivers/media/dvb/dvb-usb/dvb_usb.h b/drivers/media/dvb/dvb-usb/dvb_usb.h index 7e4832664f5d..fd6237a3a4ce 100644 --- a/drivers/media/dvb/dvb-usb/dvb_usb.h +++ b/drivers/media/dvb/dvb-usb/dvb_usb.h | |||
@@ -100,10 +100,6 @@ struct dvb_usb_adapter_properties { | |||
100 | int (*pid_filter_ctrl) (struct dvb_usb_adapter *, int); | 100 | int (*pid_filter_ctrl) (struct dvb_usb_adapter *, int); |
101 | int (*pid_filter) (struct dvb_usb_adapter *, int, u16, int); | 101 | int (*pid_filter) (struct dvb_usb_adapter *, int, u16, int); |
102 | 102 | ||
103 | int (*frontend_attach) (struct dvb_usb_adapter *); | ||
104 | int (*tuner_attach) (struct dvb_usb_adapter *); | ||
105 | int (*frontend_ctrl) (struct dvb_frontend *, int); | ||
106 | int (*streaming_ctrl) (struct dvb_usb_adapter *, int); | ||
107 | int (*fe_ioctl_override) (struct dvb_frontend *, | 103 | int (*fe_ioctl_override) (struct dvb_frontend *, |
108 | unsigned int, void *, unsigned int); | 104 | unsigned int, void *, unsigned int); |
109 | 105 | ||
@@ -189,7 +185,10 @@ struct dvb_usb_device_properties { | |||
189 | int (*power_ctrl) (struct dvb_usb_device *, int); | 185 | int (*power_ctrl) (struct dvb_usb_device *, int); |
190 | int (*read_config) (struct dvb_usb_device *d); | 186 | int (*read_config) (struct dvb_usb_device *d); |
191 | int (*read_mac_address) (struct dvb_usb_device *, u8 []); | 187 | int (*read_mac_address) (struct dvb_usb_device *, u8 []); |
192 | int (*tuner_attach) (struct dvb_frontend *); | 188 | int (*frontend_attach) (struct dvb_usb_adapter *); |
189 | int (*tuner_attach) (struct dvb_usb_adapter *); | ||
190 | int (*frontend_ctrl) (struct dvb_frontend *, int); | ||
191 | int (*streaming_ctrl) (struct dvb_usb_adapter *, int); | ||
193 | 192 | ||
194 | #define WARM 0 | 193 | #define WARM 0 |
195 | #define COLD 1 | 194 | #define COLD 1 |
diff --git a/drivers/media/dvb/dvb-usb/dvb_usb_dvb.c b/drivers/media/dvb/dvb-usb/dvb_usb_dvb.c index a08d879fd177..11ac592270fe 100644 --- a/drivers/media/dvb/dvb-usb/dvb_usb_dvb.c +++ b/drivers/media/dvb/dvb-usb/dvb_usb_dvb.c | |||
@@ -80,8 +80,8 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) | |||
80 | pr_debug("%s: stop feeding\n", __func__); | 80 | pr_debug("%s: stop feeding\n", __func__); |
81 | usb_urb_killv2(&adap->stream); | 81 | usb_urb_killv2(&adap->stream); |
82 | 82 | ||
83 | if (adap->props.streaming_ctrl != NULL) { | 83 | if (adap->dev->props.streaming_ctrl != NULL) { |
84 | ret = adap->props.streaming_ctrl(adap, 0); | 84 | ret = adap->dev->props.streaming_ctrl(adap, 0); |
85 | if (ret < 0) { | 85 | if (ret < 0) { |
86 | pr_err("%s: error while stopping stream\n", | 86 | pr_err("%s: error while stopping stream\n", |
87 | KBUILD_MODNAME); | 87 | KBUILD_MODNAME); |
@@ -157,8 +157,8 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) | |||
157 | } | 157 | } |
158 | } | 158 | } |
159 | pr_debug("%s: start feeding\n", __func__); | 159 | pr_debug("%s: start feeding\n", __func__); |
160 | if (adap->props.streaming_ctrl != NULL) { | 160 | if (adap->dev->props.streaming_ctrl != NULL) { |
161 | ret = adap->props.streaming_ctrl(adap, 1); | 161 | ret = adap->dev->props.streaming_ctrl(adap, 1); |
162 | if (ret < 0) { | 162 | if (ret < 0) { |
163 | pr_err("%s: error while enabling fifo\n", | 163 | pr_err("%s: error while enabling fifo\n", |
164 | KBUILD_MODNAME); | 164 | KBUILD_MODNAME); |
@@ -279,8 +279,8 @@ static int dvb_usb_fe_wakeup(struct dvb_frontend *fe) | |||
279 | if (ret < 0) | 279 | if (ret < 0) |
280 | goto err; | 280 | goto err; |
281 | 281 | ||
282 | if (adap->props.frontend_ctrl) { | 282 | if (adap->dev->props.frontend_ctrl) { |
283 | ret = adap->props.frontend_ctrl(fe, 1); | 283 | ret = adap->dev->props.frontend_ctrl(fe, 1); |
284 | if (ret < 0) | 284 | if (ret < 0) |
285 | goto err; | 285 | goto err; |
286 | } | 286 | } |
@@ -310,8 +310,8 @@ static int dvb_usb_fe_sleep(struct dvb_frontend *fe) | |||
310 | goto err; | 310 | goto err; |
311 | } | 311 | } |
312 | 312 | ||
313 | if (adap->props.frontend_ctrl) { | 313 | if (adap->dev->props.frontend_ctrl) { |
314 | ret = adap->props.frontend_ctrl(fe, 0); | 314 | ret = adap->dev->props.frontend_ctrl(fe, 0); |
315 | if (ret < 0) | 315 | if (ret < 0) |
316 | goto err; | 316 | goto err; |
317 | } | 317 | } |
@@ -337,8 +337,8 @@ int dvb_usbv2_adapter_frontend_init(struct dvb_usb_adapter *adap) | |||
337 | memset(adap->fe, 0, sizeof(adap->fe)); | 337 | memset(adap->fe, 0, sizeof(adap->fe)); |
338 | adap->active_fe = -1; | 338 | adap->active_fe = -1; |
339 | 339 | ||
340 | if (adap->props.frontend_attach) { | 340 | if (adap->dev->props.frontend_attach) { |
341 | ret = adap->props.frontend_attach(adap); | 341 | ret = adap->dev->props.frontend_attach(adap); |
342 | if (ret < 0) { | 342 | if (ret < 0) { |
343 | pr_debug("%s: frontend_attach() failed=%d\n", __func__, | 343 | pr_debug("%s: frontend_attach() failed=%d\n", __func__, |
344 | ret); | 344 | ret); |
@@ -350,8 +350,8 @@ int dvb_usbv2_adapter_frontend_init(struct dvb_usb_adapter *adap) | |||
350 | goto err; | 350 | goto err; |
351 | } | 351 | } |
352 | 352 | ||
353 | if (adap->props.tuner_attach) { | 353 | if (adap->dev->props.tuner_attach) { |
354 | ret = adap->props.tuner_attach(adap); | 354 | ret = adap->dev->props.tuner_attach(adap); |
355 | if (ret < 0) { | 355 | if (ret < 0) { |
356 | pr_debug("%s: tuner_attach() failed=%d\n", __func__, | 356 | pr_debug("%s: tuner_attach() failed=%d\n", __func__, |
357 | ret); | 357 | ret); |