aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/b2c2/flexcop-fe-tuner.c8
-rw-r--r--drivers/media/dvb/bt8xx/dvb-bt8xx.c8
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.c32
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.h2
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.h18
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-dvb.c8
-rw-r--r--drivers/media/dvb/ttpci/av7110.c8
-rw-r--r--drivers/media/dvb/ttpci/budget-av.c8
-rw-r--r--drivers/media/dvb/ttpci/budget-ci.c8
-rw-r--r--drivers/media/dvb/ttpci/budget-patch.c8
-rw-r--r--drivers/media/dvb/ttpci/budget.c8
-rw-r--r--drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c8
-rw-r--r--drivers/media/video/video-buf-dvb.c8
13 files changed, 54 insertions, 78 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
index e2d2e65dea52..0c3bab37d8df 100644
--- a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
+++ b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
@@ -571,9 +571,7 @@ int flexcop_frontend_init(struct flexcop_device *fc)
571 } else { 571 } else {
572 if (dvb_register_frontend(&fc->dvb_adapter, fc->fe)) { 572 if (dvb_register_frontend(&fc->dvb_adapter, fc->fe)) {
573 err("frontend registration failed!"); 573 err("frontend registration failed!");
574 dvb_detach(fc->fe->ops.release_sec, fc->fe); 574 dvb_frontend_detach(fc->fe);
575 dvb_detach(fc->fe->ops.tuner_ops.release, fc->fe);
576 dvb_detach(fc->fe->ops.release, fc->fe);
577 fc->fe = NULL; 575 fc->fe = NULL;
578 return -EINVAL; 576 return -EINVAL;
579 } 577 }
@@ -586,9 +584,7 @@ void flexcop_frontend_exit(struct flexcop_device *fc)
586{ 584{
587 if (fc->init_state & FC_STATE_FE_INIT) { 585 if (fc->init_state & FC_STATE_FE_INIT) {
588 dvb_unregister_frontend(fc->fe); 586 dvb_unregister_frontend(fc->fe);
589 dvb_detach(fc->fe->ops.release_sec, fc->fe); 587 dvb_frontend_detach(fc->fe);
590 dvb_detach(fc->fe->ops.tuner_ops.release, fc->fe);
591 dvb_detach(fc->fe->ops.release, fc->fe);
592 } 588 }
593 589
594 fc->init_state &= ~FC_STATE_FE_INIT; 590 fc->init_state &= ~FC_STATE_FE_INIT;
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index 6f0bb7360991..db1eba9a5c36 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -706,9 +706,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
706 else 706 else
707 if (dvb_register_frontend(&card->dvb_adapter, card->fe)) { 707 if (dvb_register_frontend(&card->dvb_adapter, card->fe)) {
708 printk("dvb-bt8xx: Frontend registration failed!\n"); 708 printk("dvb-bt8xx: Frontend registration failed!\n");
709 dvb_detach(card->fe->ops.release_sec, card->fe); 709 dvb_frontend_detach(card->fe);
710 dvb_detach(card->fe->ops.tuner_ops.release, card->fe);
711 dvb_detach(card->fe->ops.release, card->fe);
712 card->fe = NULL; 710 card->fe = NULL;
713 } 711 }
714} 712}
@@ -927,9 +925,7 @@ static void dvb_bt8xx_remove(struct bttv_sub_device *sub)
927 dvb_dmx_release(&card->demux); 925 dvb_dmx_release(&card->demux);
928 if (card->fe) { 926 if (card->fe) {
929 dvb_unregister_frontend(card->fe); 927 dvb_unregister_frontend(card->fe);
930 dvb_detach(card->fe->ops.release_sec, card->fe); 928 dvb_frontend_detach(card->fe);
931 dvb_detach(card->fe->ops.tuner_ops.release, card->fe);
932 dvb_detach(card->fe->ops.release, card->fe);
933 } 929 }
934 dvb_unregister_adapter(&card->dvb_adapter); 930 dvb_unregister_adapter(&card->dvb_adapter);
935 931
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index d544731bed7d..86dadc71cd61 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -1112,3 +1112,35 @@ int dvb_unregister_frontend(struct dvb_frontend* fe)
1112 return 0; 1112 return 0;
1113} 1113}
1114EXPORT_SYMBOL(dvb_unregister_frontend); 1114EXPORT_SYMBOL(dvb_unregister_frontend);
1115
1116#ifdef CONFIG_DVB_DETACH
1117void dvb_frontend_detach(struct dvb_frontend* fe)
1118{
1119 void *ptr;
1120
1121 if (fe->ops.release_sec) {
1122 fe->ops.release_sec(fe);
1123 symbol_put_addr(fe->ops.release_sec);
1124 }
1125 if (fe->ops.tuner_ops.release) {
1126 fe->ops.tuner_ops.release(fe);
1127 symbol_put_addr(fe->ops.tuner_ops.release);
1128 }
1129 ptr = (void*)fe->ops.release;
1130 if (ptr) {
1131 fe->ops.release(fe);
1132 symbol_put_addr(ptr);
1133 }
1134}
1135#else
1136void dvb_frontend_detach(struct dvb_frontend* fe)
1137{
1138 if (fe->ops.release_sec)
1139 fe->ops.release_sec(fe);
1140 if (fe->ops.tuner_ops.release)
1141 fe->ops.tuner_ops.release(fe);
1142 if (fe->ops.release)
1143 fe->ops.release(fe);
1144}
1145#endif
1146EXPORT_SYMBOL(dvb_frontend_detach);
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.h b/drivers/media/dvb/dvb-core/dvb_frontend.h
index 6bea01af4400..e5d5028b3694 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.h
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.h
@@ -158,6 +158,8 @@ extern int dvb_register_frontend(struct dvb_adapter* dvb,
158 158
159extern int dvb_unregister_frontend(struct dvb_frontend* fe); 159extern int dvb_unregister_frontend(struct dvb_frontend* fe);
160 160
161extern void dvb_frontend_detach(struct dvb_frontend* fe);
162
161extern void dvb_frontend_reinitialise(struct dvb_frontend *fe); 163extern void dvb_frontend_reinitialise(struct dvb_frontend *fe);
162 164
163extern void dvb_frontend_sleep_until(struct timeval *waketime, u32 add_usec); 165extern void dvb_frontend_sleep_until(struct timeval *waketime, u32 add_usec);
diff --git a/drivers/media/dvb/dvb-core/dvbdev.h b/drivers/media/dvb/dvb-core/dvbdev.h
index 66d91e530f85..620e7887b3d3 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.h
+++ b/drivers/media/dvb/dvb-core/dvbdev.h
@@ -102,7 +102,6 @@ extern int dvb_usercopy(struct inode *inode, struct file *file,
102 int (*func)(struct inode *inode, struct file *file, 102 int (*func)(struct inode *inode, struct file *file,
103 unsigned int cmd, void *arg)); 103 unsigned int cmd, void *arg));
104 104
105
106/** generic DVB attach function. */ 105/** generic DVB attach function. */
107#ifdef CONFIG_DVB_CORE_ATTACH 106#ifdef CONFIG_DVB_CORE_ATTACH
108#define dvb_attach(FUNCTION, ARGS...) ({ \ 107#define dvb_attach(FUNCTION, ARGS...) ({ \
@@ -118,28 +117,11 @@ extern int dvb_usercopy(struct inode *inode, struct file *file,
118 __r; \ 117 __r; \
119}) 118})
120 119
121#define dvb_detach(FUNCPTR, ARGS...) ({ \
122 typeof((FUNCPTR)) __funcptrtmp = FUNCPTR; \
123 if (__funcptrtmp) { \
124 __funcptrtmp(ARGS); \
125 symbol_put_addr(__funcptrtmp); \
126 } \
127 FUNCPTR = NULL; \
128})
129
130#else 120#else
131#define dvb_attach(FUNCTION, ARGS...) ({ \ 121#define dvb_attach(FUNCTION, ARGS...) ({ \
132 FUNCTION(ARGS); \ 122 FUNCTION(ARGS); \
133}) 123})
134 124
135#define dvb_detach(FUNCPTR, ARGS...) \
136do { \
137 if (FUNCPTR) \
138 FUNCPTR(ARGS); \
139 FUNCPTR = NULL; \
140} while(0)
141
142#endif 125#endif
143 126
144
145#endif /* #ifndef _DVBDEV_H_ */ 127#endif /* #ifndef _DVBDEV_H_ */
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
index f0da15ebe33b..9f8d3f0ca5a1 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
@@ -188,9 +188,7 @@ int dvb_usb_fe_init(struct dvb_usb_device* d)
188 188
189 if (dvb_register_frontend(&d->dvb_adap, d->fe)) { 189 if (dvb_register_frontend(&d->dvb_adap, d->fe)) {
190 err("Frontend registration failed."); 190 err("Frontend registration failed.");
191 dvb_detach(d->fe->ops.release_sec, d->fe); 191 dvb_frontend_detach(d->fe);
192 dvb_detach(d->fe->ops.tuner_ops.release, d->fe);
193 dvb_detach(d->fe->ops.release, d->fe);
194 d->fe = NULL; 192 d->fe = NULL;
195 return -ENODEV; 193 return -ENODEV;
196 } 194 }
@@ -207,9 +205,7 @@ int dvb_usb_fe_exit(struct dvb_usb_device *d)
207{ 205{
208 if (d->fe != NULL) { 206 if (d->fe != NULL) {
209 dvb_unregister_frontend(d->fe); 207 dvb_unregister_frontend(d->fe);
210 dvb_detach(d->fe->ops.release_sec, d->fe); 208 dvb_frontend_detach(d->fe);
211 dvb_detach(d->fe->ops.tuner_ops.release, d->fe);
212 dvb_detach(d->fe->ops.release, d->fe);
213 } 209 }
214 return 0; 210 return 0;
215} 211}
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index d195cf591081..5742154d8841 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -1385,9 +1385,7 @@ static void dvb_unregister(struct av7110 *av7110)
1385 1385
1386 if (av7110->fe != NULL) { 1386 if (av7110->fe != NULL) {
1387 dvb_unregister_frontend(av7110->fe); 1387 dvb_unregister_frontend(av7110->fe);
1388 dvb_detach(av7110->fe->ops.release_sec, av7110->fe); 1388 dvb_frontend_detach(av7110->fe);
1389 dvb_detach(av7110->fe->ops.tuner_ops.release, av7110->fe);
1390 dvb_detach(av7110->fe->ops.release, av7110->fe);
1391 } 1389 }
1392 dvb_unregister_device(av7110->osd_dev); 1390 dvb_unregister_device(av7110->osd_dev);
1393 av7110_av_unregister(av7110); 1391 av7110_av_unregister(av7110);
@@ -2259,9 +2257,7 @@ static int frontend_init(struct av7110 *av7110)
2259 ret = dvb_register_frontend(&av7110->dvb_adapter, av7110->fe); 2257 ret = dvb_register_frontend(&av7110->dvb_adapter, av7110->fe);
2260 if (ret < 0) { 2258 if (ret < 0) {
2261 printk("av7110: Frontend registration failed!\n"); 2259 printk("av7110: Frontend registration failed!\n");
2262 dvb_detach(av7110->fe->ops.release_sec, av7110->fe); 2260 dvb_frontend_detach(av7110->fe);
2263 dvb_detach(av7110->fe->ops.tuner_ops.release, av7110->fe);
2264 dvb_detach(av7110->fe->ops.release, av7110->fe);
2265 av7110->fe = NULL; 2261 av7110->fe = NULL;
2266 } 2262 }
2267 } 2263 }
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c
index c648c01c8ec5..6f1c41fb2cb4 100644
--- a/drivers/media/dvb/ttpci/budget-av.c
+++ b/drivers/media/dvb/ttpci/budget-av.c
@@ -1192,9 +1192,7 @@ static void frontend_init(struct budget_av *budget_av)
1192 if (dvb_register_frontend(&budget_av->budget.dvb_adapter, 1192 if (dvb_register_frontend(&budget_av->budget.dvb_adapter,
1193 budget_av->budget.dvb_frontend)) { 1193 budget_av->budget.dvb_frontend)) {
1194 printk(KERN_ERR "budget-av: Frontend registration failed!\n"); 1194 printk(KERN_ERR "budget-av: Frontend registration failed!\n");
1195 dvb_detach(budget_av->budget.dvb_frontend->ops.release_sec, budget_av->budget.dvb_frontend); 1195 dvb_frontend_detach(budget_av->budget.dvb_frontend);
1196 dvb_detach(budget_av->budget.dvb_frontend->ops.tuner_ops.release, budget_av->budget.dvb_frontend);
1197 dvb_detach(budget_av->budget.dvb_frontend->ops.release, budget_av->budget.dvb_frontend);
1198 budget_av->budget.dvb_frontend = NULL; 1196 budget_av->budget.dvb_frontend = NULL;
1199 } 1197 }
1200} 1198}
@@ -1230,9 +1228,7 @@ static int budget_av_detach(struct saa7146_dev *dev)
1230 1228
1231 if (budget_av->budget.dvb_frontend != NULL) { 1229 if (budget_av->budget.dvb_frontend != NULL) {
1232 dvb_unregister_frontend(budget_av->budget.dvb_frontend); 1230 dvb_unregister_frontend(budget_av->budget.dvb_frontend);
1233 dvb_detach(budget_av->budget.dvb_frontend->ops.release_sec, budget_av->budget.dvb_frontend); 1231 dvb_frontend_detach(budget_av->budget.dvb_frontend);
1234 dvb_detach(budget_av->budget.dvb_frontend->ops.tuner_ops.release, budget_av->budget.dvb_frontend);
1235 dvb_detach(budget_av->budget.dvb_frontend->ops.release, budget_av->budget.dvb_frontend);
1236 } 1232 }
1237 err = ttpci_budget_deinit(&budget_av->budget); 1233 err = ttpci_budget_deinit(&budget_av->budget);
1238 1234
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c
index 20b5e8dc8739..e440fa100b94 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -1065,9 +1065,7 @@ static void frontend_init(struct budget_ci *budget_ci)
1065 if (dvb_register_frontend 1065 if (dvb_register_frontend
1066 (&budget_ci->budget.dvb_adapter, budget_ci->budget.dvb_frontend)) { 1066 (&budget_ci->budget.dvb_adapter, budget_ci->budget.dvb_frontend)) {
1067 printk("budget-ci: Frontend registration failed!\n"); 1067 printk("budget-ci: Frontend registration failed!\n");
1068 dvb_detach(budget_ci->budget.dvb_frontend->ops.release_sec, budget_ci->budget.dvb_frontend); 1068 dvb_frontend_detach(budget_ci->budget.dvb_frontend);
1069 dvb_detach(budget_ci->budget.dvb_frontend->ops.tuner_ops.release, budget_ci->budget.dvb_frontend);
1070 dvb_detach(budget_ci->budget.dvb_frontend->ops.release, budget_ci->budget.dvb_frontend);
1071 budget_ci->budget.dvb_frontend = NULL; 1069 budget_ci->budget.dvb_frontend = NULL;
1072 } 1070 }
1073 } 1071 }
@@ -1117,9 +1115,7 @@ static int budget_ci_detach(struct saa7146_dev *dev)
1117 ciintf_deinit(budget_ci); 1115 ciintf_deinit(budget_ci);
1118 if (budget_ci->budget.dvb_frontend) { 1116 if (budget_ci->budget.dvb_frontend) {
1119 dvb_unregister_frontend(budget_ci->budget.dvb_frontend); 1117 dvb_unregister_frontend(budget_ci->budget.dvb_frontend);
1120 dvb_detach(budget_ci->budget.dvb_frontend->ops.release_sec, budget_ci->budget.dvb_frontend); 1118 dvb_frontend_detach(budget_ci->budget.dvb_frontend);
1121 dvb_detach(budget_ci->budget.dvb_frontend->ops.tuner_ops.release, budget_ci->budget.dvb_frontend);
1122 dvb_detach(budget_ci->budget.dvb_frontend->ops.release, budget_ci->budget.dvb_frontend);
1123 } 1119 }
1124 err = ttpci_budget_deinit(&budget_ci->budget); 1120 err = ttpci_budget_deinit(&budget_ci->budget);
1125 1121
diff --git a/drivers/media/dvb/ttpci/budget-patch.c b/drivers/media/dvb/ttpci/budget-patch.c
index 82dbef863e51..d043e1f50d92 100644
--- a/drivers/media/dvb/ttpci/budget-patch.c
+++ b/drivers/media/dvb/ttpci/budget-patch.c
@@ -367,9 +367,7 @@ static void frontend_init(struct budget_patch* budget)
367 } else { 367 } else {
368 if (dvb_register_frontend(&budget->dvb_adapter, budget->dvb_frontend)) { 368 if (dvb_register_frontend(&budget->dvb_adapter, budget->dvb_frontend)) {
369 printk("budget-av: Frontend registration failed!\n"); 369 printk("budget-av: Frontend registration failed!\n");
370 dvb_detach(budget->dvb_frontend->ops.release_sec, budget->dvb_frontend); 370 dvb_frontend_detach(budget->dvb_frontend);
371 dvb_detach(budget->dvb_frontend->ops.tuner_ops.release, budget->dvb_frontend);
372 dvb_detach(budget->dvb_frontend->ops.release, budget->dvb_frontend);
373 budget->dvb_frontend = NULL; 371 budget->dvb_frontend = NULL;
374 } 372 }
375 } 373 }
@@ -630,9 +628,7 @@ static int budget_patch_detach (struct saa7146_dev* dev)
630 628
631 if (budget->dvb_frontend) { 629 if (budget->dvb_frontend) {
632 dvb_unregister_frontend(budget->dvb_frontend); 630 dvb_unregister_frontend(budget->dvb_frontend);
633 dvb_detach(budget->dvb_frontend->ops.release_sec, budget->dvb_frontend); 631 dvb_frontend_detach(budget->dvb_frontend);
634 dvb_detach(budget->dvb_frontend->ops.tuner_ops.release, budget->dvb_frontend);
635 dvb_detach(budget->dvb_frontend->ops.release, budget->dvb_frontend);
636 } 632 }
637 err = ttpci_budget_deinit (budget); 633 err = ttpci_budget_deinit (budget);
638 634
diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c
index 19beb11f9664..e846b9620170 100644
--- a/drivers/media/dvb/ttpci/budget.c
+++ b/drivers/media/dvb/ttpci/budget.c
@@ -442,9 +442,7 @@ static void frontend_init(struct budget *budget)
442 442
443error_out: 443error_out:
444 printk("budget: Frontend registration failed!\n"); 444 printk("budget: Frontend registration failed!\n");
445 dvb_detach(budget->dvb_frontend->ops.release_sec, budget->dvb_frontend); 445 dvb_frontend_detach(budget->dvb_frontend);
446 dvb_detach(budget->dvb_frontend->ops.tuner_ops.release, budget->dvb_frontend);
447 dvb_detach(budget->dvb_frontend->ops.release, budget->dvb_frontend);
448 budget->dvb_frontend = NULL; 446 budget->dvb_frontend = NULL;
449 return; 447 return;
450} 448}
@@ -484,9 +482,7 @@ static int budget_detach (struct saa7146_dev* dev)
484 482
485 if (budget->dvb_frontend) { 483 if (budget->dvb_frontend) {
486 dvb_unregister_frontend(budget->dvb_frontend); 484 dvb_unregister_frontend(budget->dvb_frontend);
487 dvb_detach(budget->dvb_frontend->ops.release_sec, budget->dvb_frontend); 485 dvb_frontend_detach(budget->dvb_frontend);
488 dvb_detach(budget->dvb_frontend->ops.tuner_ops.release, budget->dvb_frontend);
489 dvb_detach(budget->dvb_frontend->ops.release, budget->dvb_frontend);
490 } 486 }
491 487
492 err = ttpci_budget_deinit (budget); 488 err = ttpci_budget_deinit (budget);
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index 6f58c66d6ef9..234199875f53 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -1625,9 +1625,7 @@ static void frontend_init(struct ttusb* ttusb)
1625 } else { 1625 } else {
1626 if (dvb_register_frontend(&ttusb->adapter, ttusb->fe)) { 1626 if (dvb_register_frontend(&ttusb->adapter, ttusb->fe)) {
1627 printk("dvb-ttusb-budget: Frontend registration failed!\n"); 1627 printk("dvb-ttusb-budget: Frontend registration failed!\n");
1628 dvb_detach(ttusb->fe->ops.release_sec, ttusb->fe); 1628 dvb_frontend_detach(ttusb->fe);
1629 dvb_detach(ttusb->fe->ops.tuner_ops.release, ttusb->fe);
1630 dvb_detach(ttusb->fe->ops.release, ttusb->fe);
1631 ttusb->fe = NULL; 1629 ttusb->fe = NULL;
1632 } 1630 }
1633 } 1631 }
@@ -1766,9 +1764,7 @@ static void ttusb_disconnect(struct usb_interface *intf)
1766 dvb_dmx_release(&ttusb->dvb_demux); 1764 dvb_dmx_release(&ttusb->dvb_demux);
1767 if (ttusb->fe != NULL) { 1765 if (ttusb->fe != NULL) {
1768 dvb_unregister_frontend(ttusb->fe); 1766 dvb_unregister_frontend(ttusb->fe);
1769 dvb_detach(ttusb->fe->ops.release_sec, ttusb->fe); 1767 dvb_frontend_detach(ttusb->fe);
1770 dvb_detach(ttusb->fe->ops.tuner_ops.release, ttusb->fe);
1771 dvb_detach(ttusb->fe->ops.release, ttusb->fe);
1772 } 1768 }
1773 i2c_del_adapter(&ttusb->i2c_adap); 1769 i2c_del_adapter(&ttusb->i2c_adap);
1774 dvb_unregister_adapter(&ttusb->adapter); 1770 dvb_unregister_adapter(&ttusb->adapter);
diff --git a/drivers/media/video/video-buf-dvb.c b/drivers/media/video/video-buf-dvb.c
index 376d354b27f6..f53edf1923b7 100644
--- a/drivers/media/video/video-buf-dvb.c
+++ b/drivers/media/video/video-buf-dvb.c
@@ -223,9 +223,7 @@ fail_dmxdev:
223fail_dmx: 223fail_dmx:
224 dvb_unregister_frontend(dvb->frontend); 224 dvb_unregister_frontend(dvb->frontend);
225fail_frontend: 225fail_frontend:
226 dvb_detach(dvb->frontend->ops.release_sec, dvb->frontend); 226 dvb_frontend_detach(dvb->frontend);
227 dvb_detach(dvb->frontend->ops.tuner_ops.release, dvb->frontend);
228 dvb_detach(dvb->frontend->ops.release, dvb->frontend);
229 dvb_unregister_adapter(&dvb->adapter); 227 dvb_unregister_adapter(&dvb->adapter);
230fail_adapter: 228fail_adapter:
231 return result; 229 return result;
@@ -239,9 +237,7 @@ void videobuf_dvb_unregister(struct videobuf_dvb *dvb)
239 dvb_dmxdev_release(&dvb->dmxdev); 237 dvb_dmxdev_release(&dvb->dmxdev);
240 dvb_dmx_release(&dvb->demux); 238 dvb_dmx_release(&dvb->demux);
241 dvb_unregister_frontend(dvb->frontend); 239 dvb_unregister_frontend(dvb->frontend);
242 dvb_detach(dvb->frontend->ops.release_sec, dvb->frontend); 240 dvb_frontend_detach(dvb->frontend);
243 dvb_detach(dvb->frontend->ops.tuner_ops.release, dvb->frontend);
244 dvb_detach(dvb->frontend->ops.release, dvb->frontend);
245 dvb_unregister_adapter(&dvb->adapter); 241 dvb_unregister_adapter(&dvb->adapter);
246} 242}
247 243