aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorJohannes Stezenbach <js@linuxtv.org>2005-05-17 00:54:39 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-17 10:59:33 -0400
commitfdc53a6dbfea18e621dd23ed5cfb160837d7ce52 (patch)
tree9ce191cdb07264f8c6275c1443e61b465e17d0cb /drivers/media
parent0b3f5a57bf110b519b706365c86ada199075f34e (diff)
[PATCH] dvb: modified dvb_register_adapter() to avoid kmalloc/kfree
Modified dvb_register_adapter() to avoid kmalloc/kfree. Drivers have to embed struct dvb_adapter into their private data struct from now on. (Andreas Oberritter) Signed-off-by: Johannes Stezenbach <js@linuxtv.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/b2c2/skystar2.c20
-rw-r--r--drivers/media/dvb/bt8xx/dvb-bt8xx.c20
-rw-r--r--drivers/media/dvb/bt8xx/dvb-bt8xx.h2
-rw-r--r--drivers/media/dvb/cinergyT2/cinergyT2.c12
-rw-r--r--drivers/media/dvb/dibusb/dvb-dibusb-dvb.c10
-rw-r--r--drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c4
-rw-r--r--drivers/media/dvb/dibusb/dvb-dibusb.h2
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.c9
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.h2
-rw-r--r--drivers/media/dvb/ttpci/av7110.c28
-rw-r--r--drivers/media/dvb/ttpci/av7110.h2
-rw-r--r--drivers/media/dvb/ttpci/av7110_av.c4
-rw-r--r--drivers/media/dvb/ttpci/av7110_ca.c2
-rw-r--r--drivers/media/dvb/ttpci/av7110_hw.c8
-rw-r--r--drivers/media/dvb/ttpci/av7110_v4l.c10
-rw-r--r--drivers/media/dvb/ttpci/budget-av.c12
-rw-r--r--drivers/media/dvb/ttpci/budget-ci.c6
-rw-r--r--drivers/media/dvb/ttpci/budget-core.c12
-rw-r--r--drivers/media/dvb/ttpci/budget-patch.c4
-rw-r--r--drivers/media/dvb/ttpci/budget.c4
-rw-r--r--drivers/media/dvb/ttpci/budget.h2
-rw-r--r--drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c20
-rw-r--r--drivers/media/dvb/ttusb-dec/ttusb_dec.c20
-rw-r--r--drivers/media/video/video-buf-dvb.c12
24 files changed, 110 insertions, 117 deletions
diff --git a/drivers/media/dvb/b2c2/skystar2.c b/drivers/media/dvb/b2c2/skystar2.c
index 336c178fcd5f..acbc4c34f72a 100644
--- a/drivers/media/dvb/b2c2/skystar2.c
+++ b/drivers/media/dvb/b2c2/skystar2.c
@@ -97,7 +97,7 @@ struct adapter {
97 u8 mac_addr[8]; 97 u8 mac_addr[8];
98 u32 dw_sram_type; 98 u32 dw_sram_type;
99 99
100 struct dvb_adapter *dvb_adapter; 100 struct dvb_adapter dvb_adapter;
101 struct dvb_demux demux; 101 struct dvb_demux demux;
102 struct dmxdev dmxdev; 102 struct dmxdev dmxdev;
103 struct dmx_frontend hw_frontend; 103 struct dmx_frontend hw_frontend;
@@ -2461,7 +2461,7 @@ static void frontend_init(struct adapter *skystar2)
2461 skystar2->pdev->subsystem_vendor, 2461 skystar2->pdev->subsystem_vendor,
2462 skystar2->pdev->subsystem_device); 2462 skystar2->pdev->subsystem_device);
2463 } else { 2463 } else {
2464 if (dvb_register_frontend(skystar2->dvb_adapter, skystar2->fe)) { 2464 if (dvb_register_frontend(&skystar2->dvb_adapter, skystar2->fe)) {
2465 printk("skystar2: Frontend registration failed!\n"); 2465 printk("skystar2: Frontend registration failed!\n");
2466 if (skystar2->fe->ops->release) 2466 if (skystar2->fe->ops->release)
2467 skystar2->fe->ops->release(skystar2->fe); 2467 skystar2->fe->ops->release(skystar2->fe);
@@ -2486,17 +2486,17 @@ static int skystar2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2486 if (ret < 0) 2486 if (ret < 0)
2487 goto out; 2487 goto out;
2488 2488
2489 ret = dvb_register_adapter(&dvb_adapter, skystar2_pci_driver.name, 2489 adapter = pci_get_drvdata(pdev);
2490 dvb_adapter = &adapter->dvb_adapter;
2491
2492 ret = dvb_register_adapter(dvb_adapter, skystar2_pci_driver.name,
2490 THIS_MODULE); 2493 THIS_MODULE);
2491 if (ret < 0) { 2494 if (ret < 0) {
2492 printk("%s: Error registering DVB adapter\n", __FUNCTION__); 2495 printk("%s: Error registering DVB adapter\n", __FUNCTION__);
2493 goto err_halt; 2496 goto err_halt;
2494 } 2497 }
2495 2498
2496 adapter = pci_get_drvdata(pdev);
2497
2498 dvb_adapter->priv = adapter; 2499 dvb_adapter->priv = adapter;
2499 adapter->dvb_adapter = dvb_adapter;
2500 2500
2501 2501
2502 init_MUTEX(&adapter->i2c_sem); 2502 init_MUTEX(&adapter->i2c_sem);
@@ -2541,7 +2541,7 @@ static int skystar2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2541 adapter->dmxdev.demux = dmx; 2541 adapter->dmxdev.demux = dmx;
2542 adapter->dmxdev.capabilities = 0; 2542 adapter->dmxdev.capabilities = 0;
2543 2543
2544 ret = dvb_dmxdev_init(&adapter->dmxdev, adapter->dvb_adapter); 2544 ret = dvb_dmxdev_init(&adapter->dmxdev, &adapter->dvb_adapter);
2545 if (ret < 0) 2545 if (ret < 0)
2546 goto err_dmx_release; 2546 goto err_dmx_release;
2547 2547
@@ -2559,7 +2559,7 @@ static int skystar2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2559 if (ret < 0) 2559 if (ret < 0)
2560 goto err_remove_mem_frontend; 2560 goto err_remove_mem_frontend;
2561 2561
2562 dvb_net_init(adapter->dvb_adapter, &adapter->dvbnet, &dvbdemux->dmx); 2562 dvb_net_init(&adapter->dvb_adapter, &adapter->dvbnet, &dvbdemux->dmx);
2563 2563
2564 frontend_init(adapter); 2564 frontend_init(adapter);
2565out: 2565out:
@@ -2576,7 +2576,7 @@ err_dmx_release:
2576err_i2c_del: 2576err_i2c_del:
2577 i2c_del_adapter(&adapter->i2c_adap); 2577 i2c_del_adapter(&adapter->i2c_adap);
2578err_dvb_unregister: 2578err_dvb_unregister:
2579 dvb_unregister_adapter(adapter->dvb_adapter); 2579 dvb_unregister_adapter(&adapter->dvb_adapter);
2580err_halt: 2580err_halt:
2581 driver_halt(pdev); 2581 driver_halt(pdev);
2582 goto out; 2582 goto out;
@@ -2605,7 +2605,7 @@ static void skystar2_remove(struct pci_dev *pdev)
2605 if (adapter->fe != NULL) 2605 if (adapter->fe != NULL)
2606 dvb_unregister_frontend(adapter->fe); 2606 dvb_unregister_frontend(adapter->fe);
2607 2607
2608 dvb_unregister_adapter(adapter->dvb_adapter); 2608 dvb_unregister_adapter(&adapter->dvb_adapter);
2609 2609
2610 i2c_del_adapter(&adapter->i2c_adap); 2610 i2c_del_adapter(&adapter->i2c_adap);
2611 2611
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index b735397f59aa..f9572426a148 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -531,7 +531,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
531 card->bt->dev->subsystem_vendor, 531 card->bt->dev->subsystem_vendor,
532 card->bt->dev->subsystem_device); 532 card->bt->dev->subsystem_device);
533 } else { 533 } else {
534 if (dvb_register_frontend(card->dvb_adapter, card->fe)) { 534 if (dvb_register_frontend(&card->dvb_adapter, card->fe)) {
535 printk("dvb-bt8xx: Frontend registration failed!\n"); 535 printk("dvb-bt8xx: Frontend registration failed!\n");
536 if (card->fe->ops->release) 536 if (card->fe->ops->release)
537 card->fe->ops->release(card->fe); 537 card->fe->ops->release(card->fe);
@@ -550,7 +550,7 @@ static int __init dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type)
550 return result; 550 return result;
551 551
552 } 552 }
553 card->dvb_adapter->priv = card; 553 card->dvb_adapter.priv = card;
554 554
555 card->bt->adapter = card->i2c_adapter; 555 card->bt->adapter = card->i2c_adapter;
556 556
@@ -568,7 +568,7 @@ static int __init dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type)
568 if ((result = dvb_dmx_init(&card->demux)) < 0) { 568 if ((result = dvb_dmx_init(&card->demux)) < 0) {
569 printk("dvb_bt8xx: dvb_dmx_init failed (errno = %d)\n", result); 569 printk("dvb_bt8xx: dvb_dmx_init failed (errno = %d)\n", result);
570 570
571 dvb_unregister_adapter(card->dvb_adapter); 571 dvb_unregister_adapter(&card->dvb_adapter);
572 return result; 572 return result;
573 } 573 }
574 574
@@ -576,11 +576,11 @@ static int __init dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type)
576 card->dmxdev.demux = &card->demux.dmx; 576 card->dmxdev.demux = &card->demux.dmx;
577 card->dmxdev.capabilities = 0; 577 card->dmxdev.capabilities = 0;
578 578
579 if ((result = dvb_dmxdev_init(&card->dmxdev, card->dvb_adapter)) < 0) { 579 if ((result = dvb_dmxdev_init(&card->dmxdev, &card->dvb_adapter)) < 0) {
580 printk("dvb_bt8xx: dvb_dmxdev_init failed (errno = %d)\n", result); 580 printk("dvb_bt8xx: dvb_dmxdev_init failed (errno = %d)\n", result);
581 581
582 dvb_dmx_release(&card->demux); 582 dvb_dmx_release(&card->demux);
583 dvb_unregister_adapter(card->dvb_adapter); 583 dvb_unregister_adapter(&card->dvb_adapter);
584 return result; 584 return result;
585 } 585 }
586 586
@@ -591,7 +591,7 @@ static int __init dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type)
591 591
592 dvb_dmxdev_release(&card->dmxdev); 592 dvb_dmxdev_release(&card->dmxdev);
593 dvb_dmx_release(&card->demux); 593 dvb_dmx_release(&card->demux);
594 dvb_unregister_adapter(card->dvb_adapter); 594 dvb_unregister_adapter(&card->dvb_adapter);
595 return result; 595 return result;
596 } 596 }
597 597
@@ -603,7 +603,7 @@ static int __init dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type)
603 card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_hw); 603 card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_hw);
604 dvb_dmxdev_release(&card->dmxdev); 604 dvb_dmxdev_release(&card->dmxdev);
605 dvb_dmx_release(&card->demux); 605 dvb_dmx_release(&card->demux);
606 dvb_unregister_adapter(card->dvb_adapter); 606 dvb_unregister_adapter(&card->dvb_adapter);
607 return result; 607 return result;
608 } 608 }
609 609
@@ -614,11 +614,11 @@ static int __init dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type)
614 card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_hw); 614 card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_hw);
615 dvb_dmxdev_release(&card->dmxdev); 615 dvb_dmxdev_release(&card->dmxdev);
616 dvb_dmx_release(&card->demux); 616 dvb_dmx_release(&card->demux);
617 dvb_unregister_adapter(card->dvb_adapter); 617 dvb_unregister_adapter(&card->dvb_adapter);
618 return result; 618 return result;
619 } 619 }
620 620
621 dvb_net_init(card->dvb_adapter, &card->dvbnet, &card->demux.dmx); 621 dvb_net_init(&card->dvb_adapter, &card->dvbnet, &card->demux.dmx);
622 622
623 tasklet_init(&card->bt->tasklet, dvb_bt8xx_task, (unsigned long) card); 623 tasklet_init(&card->bt->tasklet, dvb_bt8xx_task, (unsigned long) card);
624 624
@@ -759,7 +759,7 @@ static int dvb_bt8xx_remove(struct device *dev)
759 dvb_dmxdev_release(&card->dmxdev); 759 dvb_dmxdev_release(&card->dmxdev);
760 dvb_dmx_release(&card->demux); 760 dvb_dmx_release(&card->demux);
761 if (card->fe) dvb_unregister_frontend(card->fe); 761 if (card->fe) dvb_unregister_frontend(card->fe);
762 dvb_unregister_adapter(card->dvb_adapter); 762 dvb_unregister_adapter(&card->dvb_adapter);
763 763
764 kfree(card); 764 kfree(card);
765 765
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.h b/drivers/media/dvb/bt8xx/dvb-bt8xx.h
index 80ef189f930f..e9310e3a17a9 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.h
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.h
@@ -40,7 +40,7 @@ struct dvb_bt8xx_card {
40 struct semaphore lock; 40 struct semaphore lock;
41 int nfeeds; 41 int nfeeds;
42 char card_name[32]; 42 char card_name[32];
43 struct dvb_adapter *dvb_adapter; 43 struct dvb_adapter dvb_adapter;
44 struct bt878 *bt; 44 struct bt878 *bt;
45 unsigned int bttv_nr; 45 unsigned int bttv_nr;
46 struct dvb_demux demux; 46 struct dvb_demux demux;
diff --git a/drivers/media/dvb/cinergyT2/cinergyT2.c b/drivers/media/dvb/cinergyT2/cinergyT2.c
index 28d4d926de3e..96c57fde95a0 100644
--- a/drivers/media/dvb/cinergyT2/cinergyT2.c
+++ b/drivers/media/dvb/cinergyT2/cinergyT2.c
@@ -119,7 +119,7 @@ struct cinergyt2 {
119 struct dvb_demux demux; 119 struct dvb_demux demux;
120 struct usb_device *udev; 120 struct usb_device *udev;
121 struct semaphore sem; 121 struct semaphore sem;
122 struct dvb_adapter *adapter; 122 struct dvb_adapter adapter;
123 struct dvb_device *fedev; 123 struct dvb_device *fedev;
124 struct dmxdev dmxdev; 124 struct dmxdev dmxdev;
125 struct dvb_net dvbnet; 125 struct dvb_net dvbnet;
@@ -813,15 +813,15 @@ static int cinergyt2_probe (struct usb_interface *intf,
813 cinergyt2->dmxdev.demux = &cinergyt2->demux.dmx; 813 cinergyt2->dmxdev.demux = &cinergyt2->demux.dmx;
814 cinergyt2->dmxdev.capabilities = 0; 814 cinergyt2->dmxdev.capabilities = 0;
815 815
816 if ((err = dvb_dmxdev_init(&cinergyt2->dmxdev, cinergyt2->adapter)) < 0) { 816 if ((err = dvb_dmxdev_init(&cinergyt2->dmxdev, &cinergyt2->adapter)) < 0) {
817 dprintk(1, "dvb_dmxdev_init() failed (err = %d)\n", err); 817 dprintk(1, "dvb_dmxdev_init() failed (err = %d)\n", err);
818 goto bailout; 818 goto bailout;
819 } 819 }
820 820
821 if (dvb_net_init(cinergyt2->adapter, &cinergyt2->dvbnet, &cinergyt2->demux.dmx)) 821 if (dvb_net_init(&cinergyt2->adapter, &cinergyt2->dvbnet, &cinergyt2->demux.dmx))
822 dprintk(1, "dvb_net_init() failed!\n"); 822 dprintk(1, "dvb_net_init() failed!\n");
823 823
824 dvb_register_device(cinergyt2->adapter, &cinergyt2->fedev, 824 dvb_register_device(&cinergyt2->adapter, &cinergyt2->fedev,
825 &cinergyt2_fe_template, cinergyt2, 825 &cinergyt2_fe_template, cinergyt2,
826 DVB_DEVICE_FRONTEND); 826 DVB_DEVICE_FRONTEND);
827 827
@@ -848,7 +848,7 @@ static int cinergyt2_probe (struct usb_interface *intf,
848bailout: 848bailout:
849 dvb_dmxdev_release(&cinergyt2->dmxdev); 849 dvb_dmxdev_release(&cinergyt2->dmxdev);
850 dvb_dmx_release(&cinergyt2->demux); 850 dvb_dmx_release(&cinergyt2->demux);
851 dvb_unregister_adapter (cinergyt2->adapter); 851 dvb_unregister_adapter (&cinergyt2->adapter);
852 cinergyt2_free_stream_urbs (cinergyt2); 852 cinergyt2_free_stream_urbs (cinergyt2);
853 kfree(cinergyt2); 853 kfree(cinergyt2);
854 return -ENOMEM; 854 return -ENOMEM;
@@ -872,7 +872,7 @@ static void cinergyt2_disconnect (struct usb_interface *intf)
872 dvb_dmxdev_release(&cinergyt2->dmxdev); 872 dvb_dmxdev_release(&cinergyt2->dmxdev);
873 dvb_dmx_release(&cinergyt2->demux); 873 dvb_dmx_release(&cinergyt2->demux);
874 dvb_unregister_device(cinergyt2->fedev); 874 dvb_unregister_device(cinergyt2->fedev);
875 dvb_unregister_adapter(cinergyt2->adapter); 875 dvb_unregister_adapter(&cinergyt2->adapter);
876 876
877 cinergyt2_free_stream_urbs(cinergyt2); 877 cinergyt2_free_stream_urbs(cinergyt2);
878 up(&cinergyt2->sem); 878 up(&cinergyt2->sem);
diff --git a/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c b/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c
index 04e54ec093f0..400b439e804e 100644
--- a/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c
+++ b/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c
@@ -131,7 +131,7 @@ int dibusb_dvb_init(struct usb_dibusb *dib)
131 deb_info("dvb_register_adapter failed: error %d", ret); 131 deb_info("dvb_register_adapter failed: error %d", ret);
132 goto err; 132 goto err;
133 } 133 }
134 dib->adapter->priv = dib; 134 dib->adapter.priv = dib;
135 135
136/* i2c is done in dibusb_i2c_init */ 136/* i2c is done in dibusb_i2c_init */
137 137
@@ -151,18 +151,18 @@ int dibusb_dvb_init(struct usb_dibusb *dib)
151 dib->dmxdev.filternum = dib->demux.filternum; 151 dib->dmxdev.filternum = dib->demux.filternum;
152 dib->dmxdev.demux = &dib->demux.dmx; 152 dib->dmxdev.demux = &dib->demux.dmx;
153 dib->dmxdev.capabilities = 0; 153 dib->dmxdev.capabilities = 0;
154 if ((ret = dvb_dmxdev_init(&dib->dmxdev, dib->adapter)) < 0) { 154 if ((ret = dvb_dmxdev_init(&dib->dmxdev, &dib->adapter)) < 0) {
155 err("dvb_dmxdev_init failed: error %d",ret); 155 err("dvb_dmxdev_init failed: error %d",ret);
156 goto err_dmx_dev; 156 goto err_dmx_dev;
157 } 157 }
158 158
159 dvb_net_init(dib->adapter, &dib->dvb_net, &dib->demux.dmx); 159 dvb_net_init(&dib->adapter, &dib->dvb_net, &dib->demux.dmx);
160 160
161 goto success; 161 goto success;
162err_dmx_dev: 162err_dmx_dev:
163 dvb_dmx_release(&dib->demux); 163 dvb_dmx_release(&dib->demux);
164err_dmx: 164err_dmx:
165 dvb_unregister_adapter(dib->adapter); 165 dvb_unregister_adapter(&dib->adapter);
166err: 166err:
167 return ret; 167 return ret;
168success: 168success:
@@ -179,7 +179,7 @@ int dibusb_dvb_exit(struct usb_dibusb *dib)
179 dib->demux.dmx.close(&dib->demux.dmx); 179 dib->demux.dmx.close(&dib->demux.dmx);
180 dvb_dmxdev_release(&dib->dmxdev); 180 dvb_dmxdev_release(&dib->dmxdev);
181 dvb_dmx_release(&dib->demux); 181 dvb_dmx_release(&dib->demux);
182 dvb_unregister_adapter(dib->adapter); 182 dvb_unregister_adapter(&dib->adapter);
183 } 183 }
184 return 0; 184 return 0;
185} 185}
diff --git a/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c b/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c
index 2ed89488c7c4..5a71b88797d9 100644
--- a/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c
+++ b/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c
@@ -183,7 +183,7 @@ int dibusb_fe_init(struct usb_dibusb* dib)
183 dib->dibdev->name); 183 dib->dibdev->name);
184 return -ENODEV; 184 return -ENODEV;
185 } else { 185 } else {
186 if (dvb_register_frontend(dib->adapter, dib->fe)) { 186 if (dvb_register_frontend(&dib->adapter, dib->fe)) {
187 err("Frontend registration failed."); 187 err("Frontend registration failed.");
188 if (dib->fe->ops->release) 188 if (dib->fe->ops->release)
189 dib->fe->ops->release(dib->fe); 189 dib->fe->ops->release(dib->fe);
@@ -206,7 +206,7 @@ int dibusb_i2c_init(struct usb_dibusb *dib)
206{ 206{
207 int ret = 0; 207 int ret = 0;
208 208
209 dib->adapter->priv = dib; 209 dib->adapter.priv = dib;
210 210
211 strncpy(dib->i2c_adap.name,dib->dibdev->name,I2C_NAME_SIZE); 211 strncpy(dib->i2c_adap.name,dib->dibdev->name,I2C_NAME_SIZE);
212#ifdef I2C_ADAP_CLASS_TV_DIGITAL 212#ifdef I2C_ADAP_CLASS_TV_DIGITAL
diff --git a/drivers/media/dvb/dibusb/dvb-dibusb.h b/drivers/media/dvb/dibusb/dvb-dibusb.h
index 52cd35dd9d83..c965b64fb1ab 100644
--- a/drivers/media/dvb/dibusb/dvb-dibusb.h
+++ b/drivers/media/dvb/dibusb/dvb-dibusb.h
@@ -181,7 +181,7 @@ struct usb_dibusb {
181 struct semaphore i2c_sem; 181 struct semaphore i2c_sem;
182 182
183 /* dvb */ 183 /* dvb */
184 struct dvb_adapter *adapter; 184 struct dvb_adapter adapter;
185 struct dmxdev dmxdev; 185 struct dmxdev dmxdev;
186 struct dvb_demux demux; 186 struct dvb_demux demux;
187 struct dvb_net dvb_net; 187 struct dvb_net dvb_net;
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index cf4ffe38fda3..9d9662f4b8e6 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -286,9 +286,8 @@ skip:
286} 286}
287 287
288 288
289int dvb_register_adapter(struct dvb_adapter **padap, const char *name, struct module *module) 289int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct module *module)
290{ 290{
291 struct dvb_adapter *adap;
292 int num; 291 int num;
293 292
294 if (down_interruptible (&dvbdev_register_lock)) 293 if (down_interruptible (&dvbdev_register_lock))
@@ -299,11 +298,6 @@ int dvb_register_adapter(struct dvb_adapter **padap, const char *name, struct mo
299 return -ENFILE; 298 return -ENFILE;
300 } 299 }
301 300
302 if (!(*padap = adap = kmalloc(sizeof(struct dvb_adapter), GFP_KERNEL))) {
303 up(&dvbdev_register_lock);
304 return -ENOMEM;
305 }
306
307 memset (adap, 0, sizeof(struct dvb_adapter)); 301 memset (adap, 0, sizeof(struct dvb_adapter));
308 INIT_LIST_HEAD (&adap->device_list); 302 INIT_LIST_HEAD (&adap->device_list);
309 303
@@ -331,7 +325,6 @@ int dvb_unregister_adapter(struct dvb_adapter *adap)
331 return -ERESTARTSYS; 325 return -ERESTARTSYS;
332 list_del (&adap->list_head); 326 list_del (&adap->list_head);
333 up (&dvbdev_register_lock); 327 up (&dvbdev_register_lock);
334 kfree (adap);
335 return 0; 328 return 0;
336} 329}
337EXPORT_SYMBOL(dvb_unregister_adapter); 330EXPORT_SYMBOL(dvb_unregister_adapter);
diff --git a/drivers/media/dvb/dvb-core/dvbdev.h b/drivers/media/dvb/dvb-core/dvbdev.h
index 184edba3caa7..a251867f30f1 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.h
+++ b/drivers/media/dvb/dvb-core/dvbdev.h
@@ -76,7 +76,7 @@ struct dvb_device {
76}; 76};
77 77
78 78
79extern int dvb_register_adapter (struct dvb_adapter **padap, const char *name, struct module *module); 79extern int dvb_register_adapter (struct dvb_adapter *adap, const char *name, struct module *module);
80extern int dvb_unregister_adapter (struct dvb_adapter *adap); 80extern int dvb_unregister_adapter (struct dvb_adapter *adap);
81 81
82extern int dvb_register_device (struct dvb_adapter *adap, 82extern int dvb_register_device (struct dvb_adapter *adap,
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index e3f7bd68591e..8e33a850e13e 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -130,7 +130,7 @@ static void init_av7110_av(struct av7110 *av7110)
130 av7110->current_input = 0; 130 av7110->current_input = 0;
131 if (i2c_writereg(av7110, 0x20, 0x00, 0x00) == 1) { 131 if (i2c_writereg(av7110, 0x20, 0x00, 0x00) == 1) {
132 printk ("dvb-ttpci: Crystal audio DAC @ card %d detected\n", 132 printk ("dvb-ttpci: Crystal audio DAC @ card %d detected\n",
133 av7110->dvb_adapter->num); 133 av7110->dvb_adapter.num);
134 av7110->adac_type = DVB_ADAC_CRYSTAL; 134 av7110->adac_type = DVB_ADAC_CRYSTAL;
135 i2c_writereg(av7110, 0x20, 0x01, 0xd2); 135 i2c_writereg(av7110, 0x20, 0x01, 0xd2);
136 i2c_writereg(av7110, 0x20, 0x02, 0x49); 136 i2c_writereg(av7110, 0x20, 0x02, 0x49);
@@ -145,13 +145,13 @@ static void init_av7110_av(struct av7110 *av7110)
145 } 145 }
146 else if (dev->pci->subsystem_vendor == 0x110a) { 146 else if (dev->pci->subsystem_vendor == 0x110a) {
147 printk("dvb-ttpci: DVB-C w/o analog module @ card %d detected\n", 147 printk("dvb-ttpci: DVB-C w/o analog module @ card %d detected\n",
148 av7110->dvb_adapter->num); 148 av7110->dvb_adapter.num);
149 av7110->adac_type = DVB_ADAC_NONE; 149 av7110->adac_type = DVB_ADAC_NONE;
150 } 150 }
151 else { 151 else {
152 av7110->adac_type = adac; 152 av7110->adac_type = adac;
153 printk("dvb-ttpci: adac type set to %d @ card %d\n", 153 printk("dvb-ttpci: adac type set to %d @ card %d\n",
154 av7110->dvb_adapter->num, av7110->adac_type); 154 av7110->dvb_adapter.num, av7110->adac_type);
155 } 155 }
156 156
157 if (av7110->adac_type == DVB_ADAC_NONE || av7110->adac_type == DVB_ADAC_MSP) { 157 if (av7110->adac_type == DVB_ADAC_NONE || av7110->adac_type == DVB_ADAC_MSP) {
@@ -231,7 +231,7 @@ static int arm_thread(void *data)
231 231
232 if (newloops == av7110->arm_loops) { 232 if (newloops == av7110->arm_loops) {
233 printk(KERN_ERR "dvb-ttpci: ARM crashed @ card %d\n", 233 printk(KERN_ERR "dvb-ttpci: ARM crashed @ card %d\n",
234 av7110->dvb_adapter->num); 234 av7110->dvb_adapter.num);
235 235
236 arm_error(av7110); 236 arm_error(av7110);
237 av7710_set_video_mode(av7110, vidmode); 237 av7710_set_video_mode(av7110, vidmode);
@@ -1282,7 +1282,7 @@ static int av7110_register(struct av7110 *av7110)
1282 av7110->dmxdev.demux = &dvbdemux->dmx; 1282 av7110->dmxdev.demux = &dvbdemux->dmx;
1283 av7110->dmxdev.capabilities = 0; 1283 av7110->dmxdev.capabilities = 0;
1284 1284
1285 dvb_dmxdev_init(&av7110->dmxdev, av7110->dvb_adapter); 1285 dvb_dmxdev_init(&av7110->dmxdev, &av7110->dvb_adapter);
1286 1286
1287 av7110->hw_frontend.source = DMX_FRONTEND_0; 1287 av7110->hw_frontend.source = DMX_FRONTEND_0;
1288 1288
@@ -1307,11 +1307,11 @@ static int av7110_register(struct av7110 *av7110)
1307 av7110_ca_register(av7110); 1307 av7110_ca_register(av7110);
1308 1308
1309#ifdef CONFIG_DVB_AV7110_OSD 1309#ifdef CONFIG_DVB_AV7110_OSD
1310 dvb_register_device(av7110->dvb_adapter, &av7110->osd_dev, 1310 dvb_register_device(&av7110->dvb_adapter, &av7110->osd_dev,
1311 &dvbdev_osd, av7110, DVB_DEVICE_OSD); 1311 &dvbdev_osd, av7110, DVB_DEVICE_OSD);
1312#endif 1312#endif
1313 1313
1314 dvb_net_init(av7110->dvb_adapter, &av7110->dvb_net, &dvbdemux->dmx); 1314 dvb_net_init(&av7110->dvb_adapter, &av7110->dvb_net, &dvbdemux->dmx);
1315 1315
1316 if (budgetpatch) { 1316 if (budgetpatch) {
1317 /* initialize software demux1 without its own frontend 1317 /* initialize software demux1 without its own frontend
@@ -1334,9 +1334,9 @@ static int av7110_register(struct av7110 *av7110)
1334 av7110->dmxdev1.demux = &dvbdemux1->dmx; 1334 av7110->dmxdev1.demux = &dvbdemux1->dmx;
1335 av7110->dmxdev1.capabilities = 0; 1335 av7110->dmxdev1.capabilities = 0;
1336 1336
1337 dvb_dmxdev_init(&av7110->dmxdev1, av7110->dvb_adapter); 1337 dvb_dmxdev_init(&av7110->dmxdev1, &av7110->dvb_adapter);
1338 1338
1339 dvb_net_init(av7110->dvb_adapter, &av7110->dvb_net1, &dvbdemux1->dmx); 1339 dvb_net_init(&av7110->dvb_adapter, &av7110->dvb_net1, &dvbdemux1->dmx);
1340 printk("dvb-ttpci: additional demux1 for budget-patch registered\n"); 1340 printk("dvb-ttpci: additional demux1 for budget-patch registered\n");
1341 } 1341 }
1342 return 0; 1342 return 0;
@@ -2246,7 +2246,7 @@ static int frontend_init(struct av7110 *av7110)
2246 FE_FUNC_OVERRIDE(av7110->fe->ops->dishnetwork_send_legacy_command, av7110->fe_dishnetwork_send_legacy_command, av7110_fe_dishnetwork_send_legacy_command); 2246 FE_FUNC_OVERRIDE(av7110->fe->ops->dishnetwork_send_legacy_command, av7110->fe_dishnetwork_send_legacy_command, av7110_fe_dishnetwork_send_legacy_command);
2247 FE_FUNC_OVERRIDE(av7110->fe->ops->set_frontend, av7110->fe_set_frontend, av7110_fe_set_frontend); 2247 FE_FUNC_OVERRIDE(av7110->fe->ops->set_frontend, av7110->fe_set_frontend, av7110_fe_set_frontend);
2248 2248
2249 ret = dvb_register_frontend(av7110->dvb_adapter, av7110->fe); 2249 ret = dvb_register_frontend(&av7110->dvb_adapter, av7110->fe);
2250 if (ret < 0) { 2250 if (ret < 0) {
2251 printk("av7110: Frontend registration failed!\n"); 2251 printk("av7110: Frontend registration failed!\n");
2252 if (av7110->fe->ops->release) 2252 if (av7110->fe->ops->release)
@@ -2460,7 +2460,7 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d
2460 goto err_dvb_unregister_adapter_2; 2460 goto err_dvb_unregister_adapter_2;
2461 2461
2462 ttpci_eeprom_parse_mac(&av7110->i2c_adap, 2462 ttpci_eeprom_parse_mac(&av7110->i2c_adap,
2463 av7110->dvb_adapter->proposed_mac); 2463 av7110->dvb_adapter.proposed_mac);
2464 ret = -ENOMEM; 2464 ret = -ENOMEM;
2465 2465
2466 if (budgetpatch) { 2466 if (budgetpatch) {
@@ -2631,7 +2631,7 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d
2631 if (ret < 0) 2631 if (ret < 0)
2632 goto err_av7110_unregister_11; 2632 goto err_av7110_unregister_11;
2633 2633
2634 av7110->dvb_adapter->priv = av7110; 2634 av7110->dvb_adapter.priv = av7110;
2635 ret = frontend_init(av7110); 2635 ret = frontend_init(av7110);
2636 if (ret < 0) 2636 if (ret < 0)
2637 goto err_av7110_exit_v4l_12; 2637 goto err_av7110_exit_v4l_12;
@@ -2666,7 +2666,7 @@ err_saa71466_vfree_4:
2666err_i2c_del_3: 2666err_i2c_del_3:
2667 i2c_del_adapter(&av7110->i2c_adap); 2667 i2c_del_adapter(&av7110->i2c_adap);
2668err_dvb_unregister_adapter_2: 2668err_dvb_unregister_adapter_2:
2669 dvb_unregister_adapter(av7110->dvb_adapter); 2669 dvb_unregister_adapter(&av7110->dvb_adapter);
2670err_put_firmware_1: 2670err_put_firmware_1:
2671 put_firmware(av7110); 2671 put_firmware(av7110);
2672err_kfree_0: 2672err_kfree_0:
@@ -2712,7 +2712,7 @@ static int av7110_detach(struct saa7146_dev* saa)
2712 2712
2713 i2c_del_adapter(&av7110->i2c_adap); 2713 i2c_del_adapter(&av7110->i2c_adap);
2714 2714
2715 dvb_unregister_adapter (av7110->dvb_adapter); 2715 dvb_unregister_adapter (&av7110->dvb_adapter);
2716 2716
2717 av7110_num--; 2717 av7110_num--;
2718 2718
diff --git a/drivers/media/dvb/ttpci/av7110.h b/drivers/media/dvb/ttpci/av7110.h
index ee6237b926bf..4f69b4d01479 100644
--- a/drivers/media/dvb/ttpci/av7110.h
+++ b/drivers/media/dvb/ttpci/av7110.h
@@ -220,7 +220,7 @@ struct av7110 {
220 220
221 struct audio_mixer mixer; 221 struct audio_mixer mixer;
222 222
223 struct dvb_adapter *dvb_adapter; 223 struct dvb_adapter dvb_adapter;
224 struct dvb_device *video_dev; 224 struct dvb_device *video_dev;
225 struct dvb_device *audio_dev; 225 struct dvb_device *audio_dev;
226 struct dvb_device *ca_dev; 226 struct dvb_device *ca_dev;
diff --git a/drivers/media/dvb/ttpci/av7110_av.c b/drivers/media/dvb/ttpci/av7110_av.c
index f90e1cf2419c..ccf946125d02 100644
--- a/drivers/media/dvb/ttpci/av7110_av.c
+++ b/drivers/media/dvb/ttpci/av7110_av.c
@@ -1415,10 +1415,10 @@ int av7110_av_register(struct av7110 *av7110)
1415 av7110->video_events.overflow = 0; 1415 av7110->video_events.overflow = 0;
1416 memset(&av7110->video_size, 0, sizeof (video_size_t)); 1416 memset(&av7110->video_size, 0, sizeof (video_size_t));
1417 1417
1418 dvb_register_device(av7110->dvb_adapter, &av7110->video_dev, 1418 dvb_register_device(&av7110->dvb_adapter, &av7110->video_dev,
1419 &dvbdev_video, av7110, DVB_DEVICE_VIDEO); 1419 &dvbdev_video, av7110, DVB_DEVICE_VIDEO);
1420 1420
1421 dvb_register_device(av7110->dvb_adapter, &av7110->audio_dev, 1421 dvb_register_device(&av7110->dvb_adapter, &av7110->audio_dev,
1422 &dvbdev_audio, av7110, DVB_DEVICE_AUDIO); 1422 &dvbdev_audio, av7110, DVB_DEVICE_AUDIO);
1423 1423
1424 return 0; 1424 return 0;
diff --git a/drivers/media/dvb/ttpci/av7110_ca.c b/drivers/media/dvb/ttpci/av7110_ca.c
index 75173a22f5cf..c3801e328fe9 100644
--- a/drivers/media/dvb/ttpci/av7110_ca.c
+++ b/drivers/media/dvb/ttpci/av7110_ca.c
@@ -370,7 +370,7 @@ static struct dvb_device dvbdev_ca = {
370 370
371int av7110_ca_register(struct av7110 *av7110) 371int av7110_ca_register(struct av7110 *av7110)
372{ 372{
373 return dvb_register_device(av7110->dvb_adapter, &av7110->ca_dev, 373 return dvb_register_device(&av7110->dvb_adapter, &av7110->ca_dev,
374 &dvbdev_ca, av7110, DVB_DEVICE_CA); 374 &dvbdev_ca, av7110, DVB_DEVICE_CA);
375} 375}
376 376
diff --git a/drivers/media/dvb/ttpci/av7110_hw.c b/drivers/media/dvb/ttpci/av7110_hw.c
index 7c95d63f7249..7fa4a0ebe133 100644
--- a/drivers/media/dvb/ttpci/av7110_hw.c
+++ b/drivers/media/dvb/ttpci/av7110_hw.c
@@ -619,7 +619,7 @@ int av7110_firmversion(struct av7110 *av7110)
619 619
620 if (av7110_fw_query(av7110, tag, buf, 16)) { 620 if (av7110_fw_query(av7110, tag, buf, 16)) {
621 printk("dvb-ttpci: failed to boot firmware @ card %d\n", 621 printk("dvb-ttpci: failed to boot firmware @ card %d\n",
622 av7110->dvb_adapter->num); 622 av7110->dvb_adapter.num);
623 return -EIO; 623 return -EIO;
624 } 624 }
625 625
@@ -630,16 +630,16 @@ int av7110_firmversion(struct av7110 *av7110)
630 av7110->avtype = (buf[8] << 16) + buf[9]; 630 av7110->avtype = (buf[8] << 16) + buf[9];
631 631
632 printk("dvb-ttpci: info @ card %d: firm %08x, rtsl %08x, vid %08x, app %08x\n", 632 printk("dvb-ttpci: info @ card %d: firm %08x, rtsl %08x, vid %08x, app %08x\n",
633 av7110->dvb_adapter->num, av7110->arm_fw, 633 av7110->dvb_adapter.num, av7110->arm_fw,
634 av7110->arm_rtsl, av7110->arm_vid, av7110->arm_app); 634 av7110->arm_rtsl, av7110->arm_vid, av7110->arm_app);
635 635
636 /* print firmware capabilities */ 636 /* print firmware capabilities */
637 if (FW_CI_LL_SUPPORT(av7110->arm_app)) 637 if (FW_CI_LL_SUPPORT(av7110->arm_app))
638 printk("dvb-ttpci: firmware @ card %d supports CI link layer interface\n", 638 printk("dvb-ttpci: firmware @ card %d supports CI link layer interface\n",
639 av7110->dvb_adapter->num); 639 av7110->dvb_adapter.num);
640 else 640 else
641 printk("dvb-ttpci: no firmware support for CI link layer interface @ card %d\n", 641 printk("dvb-ttpci: no firmware support for CI link layer interface @ card %d\n",
642 av7110->dvb_adapter->num); 642 av7110->dvb_adapter.num);
643 643
644 return 0; 644 return 0;
645} 645}
diff --git a/drivers/media/dvb/ttpci/av7110_v4l.c b/drivers/media/dvb/ttpci/av7110_v4l.c
index 62c905a2d17c..e65fc36e2ce8 100644
--- a/drivers/media/dvb/ttpci/av7110_v4l.c
+++ b/drivers/media/dvb/ttpci/av7110_v4l.c
@@ -46,7 +46,7 @@ int msp_writereg(struct av7110 *av7110, u8 dev, u16 reg, u16 val)
46 46
47 if (i2c_transfer(&av7110->i2c_adap, &msgs, 1) != 1) { 47 if (i2c_transfer(&av7110->i2c_adap, &msgs, 1) != 1) {
48 dprintk(1, "dvb-ttpci: failed @ card %d, %u = %u\n", 48 dprintk(1, "dvb-ttpci: failed @ card %d, %u = %u\n",
49 av7110->dvb_adapter->num, reg, val); 49 av7110->dvb_adapter.num, reg, val);
50 return -EIO; 50 return -EIO;
51 } 51 }
52 return 0; 52 return 0;
@@ -63,7 +63,7 @@ static int msp_readreg(struct av7110 *av7110, u8 dev, u16 reg, u16 *val)
63 63
64 if (i2c_transfer(&av7110->i2c_adap, &msgs[0], 2) != 2) { 64 if (i2c_transfer(&av7110->i2c_adap, &msgs[0], 2) != 2) {
65 dprintk(1, "dvb-ttpci: failed @ card %d, %u\n", 65 dprintk(1, "dvb-ttpci: failed @ card %d, %u\n",
66 av7110->dvb_adapter->num, reg); 66 av7110->dvb_adapter.num, reg);
67 return -EIO; 67 return -EIO;
68 } 68 }
69 *val = (msg2[0] << 8) | msg2[1]; 69 *val = (msg2[0] << 8) | msg2[1];
@@ -552,13 +552,13 @@ int av7110_init_analog_module(struct av7110 *av7110)
552 return -ENODEV; 552 return -ENODEV;
553 553
554 printk("dvb-ttpci: DVB-C analog module @ card %d detected, initializing MSP3400\n", 554 printk("dvb-ttpci: DVB-C analog module @ card %d detected, initializing MSP3400\n",
555 av7110->dvb_adapter->num); 555 av7110->dvb_adapter.num);
556 av7110->adac_type = DVB_ADAC_MSP; 556 av7110->adac_type = DVB_ADAC_MSP;
557 msleep(100); // the probing above resets the msp... 557 msleep(100); // the probing above resets the msp...
558 msp_readreg(av7110, MSP_RD_DSP, 0x001e, &version1); 558 msp_readreg(av7110, MSP_RD_DSP, 0x001e, &version1);
559 msp_readreg(av7110, MSP_RD_DSP, 0x001f, &version2); 559 msp_readreg(av7110, MSP_RD_DSP, 0x001f, &version2);
560 dprintk(1, "dvb-ttpci: @ card %d MSP3400 version 0x%04x 0x%04x\n", 560 dprintk(1, "dvb-ttpci: @ card %d MSP3400 version 0x%04x 0x%04x\n",
561 av7110->dvb_adapter->num, version1, version2); 561 av7110->dvb_adapter.num, version1, version2);
562 msp_writereg(av7110, MSP_WR_DSP, 0x0013, 0x0c00); 562 msp_writereg(av7110, MSP_WR_DSP, 0x0013, 0x0c00);
563 msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0x7f00); // loudspeaker + headphone 563 msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0x7f00); // loudspeaker + headphone
564 msp_writereg(av7110, MSP_WR_DSP, 0x0008, 0x0220); // loudspeaker source 564 msp_writereg(av7110, MSP_WR_DSP, 0x0008, 0x0220); // loudspeaker source
@@ -596,7 +596,7 @@ int av7110_init_analog_module(struct av7110 *av7110)
596 /* init the saa7113 */ 596 /* init the saa7113 */
597 while (*i != 0xff) { 597 while (*i != 0xff) {
598 if (i2c_writereg(av7110, 0x48, i[0], i[1]) != 1) { 598 if (i2c_writereg(av7110, 0x48, i[0], i[1]) != 1) {
599 dprintk(1, "saa7113 initialization failed @ card %d", av7110->dvb_adapter->num); 599 dprintk(1, "saa7113 initialization failed @ card %d", av7110->dvb_adapter.num);
600 break; 600 break;
601 } 601 }
602 i += 2; 602 i += 2;
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c
index 9860caf32495..7891f3f06f04 100644
--- a/drivers/media/dvb/ttpci/budget-av.c
+++ b/drivers/media/dvb/ttpci/budget-av.c
@@ -297,7 +297,7 @@ static int ciintf_init(struct budget_av *budget_av)
297 budget_av->ca.slot_ts_enable = ciintf_slot_ts_enable; 297 budget_av->ca.slot_ts_enable = ciintf_slot_ts_enable;
298 budget_av->ca.poll_slot_status = ciintf_poll_slot_status; 298 budget_av->ca.poll_slot_status = ciintf_poll_slot_status;
299 budget_av->ca.data = budget_av; 299 budget_av->ca.data = budget_av;
300 if ((result = dvb_ca_en50221_init(budget_av->budget.dvb_adapter, 300 if ((result = dvb_ca_en50221_init(&budget_av->budget.dvb_adapter,
301 &budget_av->ca, 0, 1)) != 0) { 301 &budget_av->ca, 0, 1)) != 0) {
302 printk("budget_av: CI interface detected, but initialisation failed.\n"); 302 printk("budget_av: CI interface detected, but initialisation failed.\n");
303 goto error; 303 goto error;
@@ -767,7 +767,7 @@ static void frontend_init(struct budget_av *budget_av)
767 budget_av->budget.dev->pci->subsystem_device); 767 budget_av->budget.dev->pci->subsystem_device);
768 } else { 768 } else {
769 if (dvb_register_frontend 769 if (dvb_register_frontend
770 (budget_av->budget.dvb_adapter, budget_av->budget.dvb_frontend)) { 770 (&budget_av->budget.dvb_adapter, budget_av->budget.dvb_frontend)) {
771 printk("budget-av: Frontend registration failed!\n"); 771 printk("budget-av: Frontend registration failed!\n");
772 if (budget_av->budget.dvb_frontend->ops->release) 772 if (budget_av->budget.dvb_frontend->ops->release)
773 budget_av->budget.dvb_frontend->ops->release(budget_av->budget.dvb_frontend); 773 budget_av->budget.dvb_frontend->ops->release(budget_av->budget.dvb_frontend);
@@ -875,18 +875,18 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
875 /* fixme: find some sane values here... */ 875 /* fixme: find some sane values here... */
876 saa7146_write(dev, PCI_BT_V1, 0x1c00101f); 876 saa7146_write(dev, PCI_BT_V1, 0x1c00101f);
877 877
878 mac = budget_av->budget.dvb_adapter->proposed_mac; 878 mac = budget_av->budget.dvb_adapter.proposed_mac;
879 if (i2c_readregs(&budget_av->budget.i2c_adap, 0xa0, 0x30, mac, 6)) { 879 if (i2c_readregs(&budget_av->budget.i2c_adap, 0xa0, 0x30, mac, 6)) {
880 printk("KNC1-%d: Could not read MAC from KNC1 card\n", 880 printk("KNC1-%d: Could not read MAC from KNC1 card\n",
881 budget_av->budget.dvb_adapter->num); 881 budget_av->budget.dvb_adapter.num);
882 memset(mac, 0, 6); 882 memset(mac, 0, 6);
883 } else { 883 } else {
884 printk("KNC1-%d: MAC addr = %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", 884 printk("KNC1-%d: MAC addr = %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
885 budget_av->budget.dvb_adapter->num, 885 budget_av->budget.dvb_adapter.num,
886 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 886 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
887 } 887 }
888 888
889 budget_av->budget.dvb_adapter->priv = budget_av; 889 budget_av->budget.dvb_adapter.priv = budget_av;
890 frontend_init(budget_av); 890 frontend_init(budget_av);
891 891
892 if (enable_ci) 892 if (enable_ci)
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c
index 521111be3558..dce116111376 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -395,7 +395,7 @@ static int ciintf_init(struct budget_ci *budget_ci)
395 budget_ci->ca.slot_shutdown = ciintf_slot_shutdown; 395 budget_ci->ca.slot_shutdown = ciintf_slot_shutdown;
396 budget_ci->ca.slot_ts_enable = ciintf_slot_ts_enable; 396 budget_ci->ca.slot_ts_enable = ciintf_slot_ts_enable;
397 budget_ci->ca.data = budget_ci; 397 budget_ci->ca.data = budget_ci;
398 if ((result = dvb_ca_en50221_init(budget_ci->budget.dvb_adapter, 398 if ((result = dvb_ca_en50221_init(&budget_ci->budget.dvb_adapter,
399 &budget_ci->ca, 399 &budget_ci->ca,
400 DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE | 400 DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE |
401 DVB_CA_EN50221_FLAG_IRQ_FR | 401 DVB_CA_EN50221_FLAG_IRQ_FR |
@@ -881,7 +881,7 @@ static void frontend_init(struct budget_ci *budget_ci)
881 budget_ci->budget.dev->pci->subsystem_device); 881 budget_ci->budget.dev->pci->subsystem_device);
882 } else { 882 } else {
883 if (dvb_register_frontend 883 if (dvb_register_frontend
884 (budget_ci->budget.dvb_adapter, budget_ci->budget.dvb_frontend)) { 884 (&budget_ci->budget.dvb_adapter, budget_ci->budget.dvb_frontend)) {
885 printk("budget-ci: Frontend registration failed!\n"); 885 printk("budget-ci: Frontend registration failed!\n");
886 if (budget_ci->budget.dvb_frontend->ops->release) 886 if (budget_ci->budget.dvb_frontend->ops->release)
887 budget_ci->budget.dvb_frontend->ops->release(budget_ci->budget.dvb_frontend); 887 budget_ci->budget.dvb_frontend->ops->release(budget_ci->budget.dvb_frontend);
@@ -916,7 +916,7 @@ static int budget_ci_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
916 916
917 ciintf_init(budget_ci); 917 ciintf_init(budget_ci);
918 918
919 budget_ci->budget.dvb_adapter->priv = budget_ci; 919 budget_ci->budget.dvb_adapter.priv = budget_ci;
920 frontend_init(budget_ci); 920 frontend_init(budget_ci);
921 921
922 return 0; 922 return 0;
diff --git a/drivers/media/dvb/ttpci/budget-core.c b/drivers/media/dvb/ttpci/budget-core.c
index 93a9b40917e4..0498a055a4cd 100644
--- a/drivers/media/dvb/ttpci/budget-core.c
+++ b/drivers/media/dvb/ttpci/budget-core.c
@@ -298,7 +298,7 @@ static int budget_register(struct budget *budget)
298 budget->dmxdev.demux = &dvbdemux->dmx; 298 budget->dmxdev.demux = &dvbdemux->dmx;
299 budget->dmxdev.capabilities = 0; 299 budget->dmxdev.capabilities = 0;
300 300
301 dvb_dmxdev_init(&budget->dmxdev, budget->dvb_adapter); 301 dvb_dmxdev_init(&budget->dmxdev, &budget->dvb_adapter);
302 302
303 budget->hw_frontend.source = DMX_FRONTEND_0; 303 budget->hw_frontend.source = DMX_FRONTEND_0;
304 304
@@ -316,7 +316,7 @@ static int budget_register(struct budget *budget)
316 if (ret < 0) 316 if (ret < 0)
317 return ret; 317 return ret;
318 318
319 dvb_net_init(budget->dvb_adapter, &budget->dvb_net, &dvbdemux->dmx); 319 dvb_net_init(&budget->dvb_adapter, &budget->dvb_net, &dvbdemux->dmx);
320 320
321 return 0; 321 return 0;
322} 322}
@@ -385,11 +385,11 @@ int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev,
385 strcpy(budget->i2c_adap.name, budget->card->name); 385 strcpy(budget->i2c_adap.name, budget->card->name);
386 386
387 if (i2c_add_adapter(&budget->i2c_adap) < 0) { 387 if (i2c_add_adapter(&budget->i2c_adap) < 0) {
388 dvb_unregister_adapter(budget->dvb_adapter); 388 dvb_unregister_adapter(&budget->dvb_adapter);
389 return -ENOMEM; 389 return -ENOMEM;
390 } 390 }
391 391
392 ttpci_eeprom_parse_mac(&budget->i2c_adap, budget->dvb_adapter->proposed_mac); 392 ttpci_eeprom_parse_mac(&budget->i2c_adap, budget->dvb_adapter.proposed_mac);
393 393
394 if (NULL == 394 if (NULL ==
395 (budget->grabbing = saa7146_vmalloc_build_pgtable(dev->pci, length, &budget->pt))) { 395 (budget->grabbing = saa7146_vmalloc_build_pgtable(dev->pci, length, &budget->pt))) {
@@ -417,7 +417,7 @@ err:
417 417
418 vfree(budget->grabbing); 418 vfree(budget->grabbing);
419 419
420 dvb_unregister_adapter(budget->dvb_adapter); 420 dvb_unregister_adapter(&budget->dvb_adapter);
421 421
422 return ret; 422 return ret;
423} 423}
@@ -432,7 +432,7 @@ int ttpci_budget_deinit(struct budget *budget)
432 432
433 i2c_del_adapter(&budget->i2c_adap); 433 i2c_del_adapter(&budget->i2c_adap);
434 434
435 dvb_unregister_adapter(budget->dvb_adapter); 435 dvb_unregister_adapter(&budget->dvb_adapter);
436 436
437 tasklet_kill(&budget->vpe_tasklet); 437 tasklet_kill(&budget->vpe_tasklet);
438 438
diff --git a/drivers/media/dvb/ttpci/budget-patch.c b/drivers/media/dvb/ttpci/budget-patch.c
index 5d524a4f213f..8142e26b47f5 100644
--- a/drivers/media/dvb/ttpci/budget-patch.c
+++ b/drivers/media/dvb/ttpci/budget-patch.c
@@ -453,7 +453,7 @@ static void frontend_init(struct budget_patch* budget)
453 budget->dev->pci->subsystem_vendor, 453 budget->dev->pci->subsystem_vendor,
454 budget->dev->pci->subsystem_device); 454 budget->dev->pci->subsystem_device);
455 } else { 455 } else {
456 if (dvb_register_frontend(budget->dvb_adapter, budget->dvb_frontend)) { 456 if (dvb_register_frontend(&budget->dvb_adapter, budget->dvb_frontend)) {
457 printk("budget-av: Frontend registration failed!\n"); 457 printk("budget-av: Frontend registration failed!\n");
458 if (budget->dvb_frontend->ops->release) 458 if (budget->dvb_frontend->ops->release)
459 budget->dvb_frontend->ops->release(budget->dvb_frontend); 459 budget->dvb_frontend->ops->release(budget->dvb_frontend);
@@ -702,7 +702,7 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte
702 702
703 dev->ext_priv = budget; 703 dev->ext_priv = budget;
704 704
705 budget->dvb_adapter->priv = budget; 705 budget->dvb_adapter.priv = budget;
706 frontend_init(budget); 706 frontend_init(budget);
707 707
708 return 0; 708 return 0;
diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c
index 5e6a10f4ad95..083fd44e5f90 100644
--- a/drivers/media/dvb/ttpci/budget.c
+++ b/drivers/media/dvb/ttpci/budget.c
@@ -468,7 +468,7 @@ static void frontend_init(struct budget *budget)
468 budget->dev->pci->subsystem_vendor, 468 budget->dev->pci->subsystem_vendor,
469 budget->dev->pci->subsystem_device); 469 budget->dev->pci->subsystem_device);
470 } else { 470 } else {
471 if (dvb_register_frontend(budget->dvb_adapter, budget->dvb_frontend)) { 471 if (dvb_register_frontend(&budget->dvb_adapter, budget->dvb_frontend)) {
472 printk("budget: Frontend registration failed!\n"); 472 printk("budget: Frontend registration failed!\n");
473 if (budget->dvb_frontend->ops->release) 473 if (budget->dvb_frontend->ops->release)
474 budget->dvb_frontend->ops->release(budget->dvb_frontend); 474 budget->dvb_frontend->ops->release(budget->dvb_frontend);
@@ -497,7 +497,7 @@ static int budget_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_
497 return err; 497 return err;
498 } 498 }
499 499
500 budget->dvb_adapter->priv = budget; 500 budget->dvb_adapter.priv = budget;
501 frontend_init(budget); 501 frontend_init(budget);
502 502
503 return 0; 503 return 0;
diff --git a/drivers/media/dvb/ttpci/budget.h b/drivers/media/dvb/ttpci/budget.h
index 6d82a6f4e43a..c6ef496ba70a 100644
--- a/drivers/media/dvb/ttpci/budget.h
+++ b/drivers/media/dvb/ttpci/budget.h
@@ -64,7 +64,7 @@ struct budget {
64 64
65 spinlock_t debilock; 65 spinlock_t debilock;
66 66
67 struct dvb_adapter *dvb_adapter; 67 struct dvb_adapter dvb_adapter;
68 struct dvb_frontend *dvb_frontend; 68 struct dvb_frontend *dvb_frontend;
69 void *priv; 69 void *priv;
70}; 70};
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index dc7e81b8a2fc..afa0e7a0e506 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -84,7 +84,7 @@ struct ttusb {
84 struct semaphore semi2c; 84 struct semaphore semi2c;
85 struct semaphore semusb; 85 struct semaphore semusb;
86 86
87 struct dvb_adapter *adapter; 87 struct dvb_adapter adapter;
88 struct usb_device *dev; 88 struct usb_device *dev;
89 89
90 struct i2c_adapter i2c_adap; 90 struct i2c_adapter i2c_adap;
@@ -1412,7 +1412,7 @@ static void frontend_init(struct ttusb* ttusb)
1412 le16_to_cpu(ttusb->dev->descriptor.idVendor), 1412 le16_to_cpu(ttusb->dev->descriptor.idVendor),
1413 le16_to_cpu(ttusb->dev->descriptor.idProduct)); 1413 le16_to_cpu(ttusb->dev->descriptor.idProduct));
1414 } else { 1414 } else {
1415 if (dvb_register_frontend(ttusb->adapter, ttusb->fe)) { 1415 if (dvb_register_frontend(&ttusb->adapter, ttusb->fe)) {
1416 printk("dvb-ttusb-budget: Frontend registration failed!\n"); 1416 printk("dvb-ttusb-budget: Frontend registration failed!\n");
1417 if (ttusb->fe->ops->release) 1417 if (ttusb->fe->ops->release)
1418 ttusb->fe->ops->release(ttusb->fe); 1418 ttusb->fe->ops->release(ttusb->fe);
@@ -1462,7 +1462,7 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
1462 up(&ttusb->semi2c); 1462 up(&ttusb->semi2c);
1463 1463
1464 dvb_register_adapter(&ttusb->adapter, "Technotrend/Hauppauge Nova-USB", THIS_MODULE); 1464 dvb_register_adapter(&ttusb->adapter, "Technotrend/Hauppauge Nova-USB", THIS_MODULE);
1465 ttusb->adapter->priv = ttusb; 1465 ttusb->adapter.priv = ttusb;
1466 1466
1467 /* i2c */ 1467 /* i2c */
1468 memset(&ttusb->i2c_adap, 0, sizeof(struct i2c_adapter)); 1468 memset(&ttusb->i2c_adap, 0, sizeof(struct i2c_adapter));
@@ -1481,7 +1481,7 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
1481 1481
1482 result = i2c_add_adapter(&ttusb->i2c_adap); 1482 result = i2c_add_adapter(&ttusb->i2c_adap);
1483 if (result) { 1483 if (result) {
1484 dvb_unregister_adapter (ttusb->adapter); 1484 dvb_unregister_adapter (&ttusb->adapter);
1485 return result; 1485 return result;
1486 } 1486 }
1487 1487
@@ -1503,7 +1503,7 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
1503 if ((result = dvb_dmx_init(&ttusb->dvb_demux)) < 0) { 1503 if ((result = dvb_dmx_init(&ttusb->dvb_demux)) < 0) {
1504 printk("ttusb_dvb: dvb_dmx_init failed (errno = %d)\n", result); 1504 printk("ttusb_dvb: dvb_dmx_init failed (errno = %d)\n", result);
1505 i2c_del_adapter(&ttusb->i2c_adap); 1505 i2c_del_adapter(&ttusb->i2c_adap);
1506 dvb_unregister_adapter (ttusb->adapter); 1506 dvb_unregister_adapter (&ttusb->adapter);
1507 return -ENODEV; 1507 return -ENODEV;
1508 } 1508 }
1509//FIXME dmxdev (nur WAS?) 1509//FIXME dmxdev (nur WAS?)
@@ -1511,21 +1511,21 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
1511 ttusb->dmxdev.demux = &ttusb->dvb_demux.dmx; 1511 ttusb->dmxdev.demux = &ttusb->dvb_demux.dmx;
1512 ttusb->dmxdev.capabilities = 0; 1512 ttusb->dmxdev.capabilities = 0;
1513 1513
1514 if ((result = dvb_dmxdev_init(&ttusb->dmxdev, ttusb->adapter)) < 0) { 1514 if ((result = dvb_dmxdev_init(&ttusb->dmxdev, &ttusb->adapter)) < 0) {
1515 printk("ttusb_dvb: dvb_dmxdev_init failed (errno = %d)\n", 1515 printk("ttusb_dvb: dvb_dmxdev_init failed (errno = %d)\n",
1516 result); 1516 result);
1517 dvb_dmx_release(&ttusb->dvb_demux); 1517 dvb_dmx_release(&ttusb->dvb_demux);
1518 i2c_del_adapter(&ttusb->i2c_adap); 1518 i2c_del_adapter(&ttusb->i2c_adap);
1519 dvb_unregister_adapter (ttusb->adapter); 1519 dvb_unregister_adapter (&ttusb->adapter);
1520 return -ENODEV; 1520 return -ENODEV;
1521 } 1521 }
1522 1522
1523 if (dvb_net_init(ttusb->adapter, &ttusb->dvbnet, &ttusb->dvb_demux.dmx)) { 1523 if (dvb_net_init(&ttusb->adapter, &ttusb->dvbnet, &ttusb->dvb_demux.dmx)) {
1524 printk("ttusb_dvb: dvb_net_init failed!\n"); 1524 printk("ttusb_dvb: dvb_net_init failed!\n");
1525 dvb_dmxdev_release(&ttusb->dmxdev); 1525 dvb_dmxdev_release(&ttusb->dmxdev);
1526 dvb_dmx_release(&ttusb->dvb_demux); 1526 dvb_dmx_release(&ttusb->dvb_demux);
1527 i2c_del_adapter(&ttusb->i2c_adap); 1527 i2c_del_adapter(&ttusb->i2c_adap);
1528 dvb_unregister_adapter (ttusb->adapter); 1528 dvb_unregister_adapter (&ttusb->adapter);
1529 return -ENODEV; 1529 return -ENODEV;
1530 } 1530 }
1531 1531
@@ -1559,7 +1559,7 @@ static void ttusb_disconnect(struct usb_interface *intf)
1559 dvb_dmx_release(&ttusb->dvb_demux); 1559 dvb_dmx_release(&ttusb->dvb_demux);
1560 if (ttusb->fe != NULL) dvb_unregister_frontend(ttusb->fe); 1560 if (ttusb->fe != NULL) dvb_unregister_frontend(ttusb->fe);
1561 i2c_del_adapter(&ttusb->i2c_adap); 1561 i2c_del_adapter(&ttusb->i2c_adap);
1562 dvb_unregister_adapter(ttusb->adapter); 1562 dvb_unregister_adapter(&ttusb->adapter);
1563 1563
1564 ttusb_free_iso_urbs(ttusb); 1564 ttusb_free_iso_urbs(ttusb);
1565 1565
diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
index 7b880aca88d6..505bdaff5a7e 100644
--- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -98,7 +98,7 @@ struct ttusb_dec {
98 int can_playback; 98 int can_playback;
99 99
100 /* DVB bits */ 100 /* DVB bits */
101 struct dvb_adapter *adapter; 101 struct dvb_adapter adapter;
102 struct dmxdev dmxdev; 102 struct dmxdev dmxdev;
103 struct dvb_demux demux; 103 struct dvb_demux demux;
104 struct dmx_frontend frontend; 104 struct dmx_frontend frontend;
@@ -1435,7 +1435,7 @@ static int ttusb_dec_init_dvb(struct ttusb_dec *dec)
1435 printk("%s: dvb_dmx_init failed: error %d\n", __FUNCTION__, 1435 printk("%s: dvb_dmx_init failed: error %d\n", __FUNCTION__,
1436 result); 1436 result);
1437 1437
1438 dvb_unregister_adapter(dec->adapter); 1438 dvb_unregister_adapter(&dec->adapter);
1439 1439
1440 return result; 1440 return result;
1441 } 1441 }
@@ -1444,12 +1444,12 @@ static int ttusb_dec_init_dvb(struct ttusb_dec *dec)
1444 dec->dmxdev.demux = &dec->demux.dmx; 1444 dec->dmxdev.demux = &dec->demux.dmx;
1445 dec->dmxdev.capabilities = 0; 1445 dec->dmxdev.capabilities = 0;
1446 1446
1447 if ((result = dvb_dmxdev_init(&dec->dmxdev, dec->adapter)) < 0) { 1447 if ((result = dvb_dmxdev_init(&dec->dmxdev, &dec->adapter)) < 0) {
1448 printk("%s: dvb_dmxdev_init failed: error %d\n", 1448 printk("%s: dvb_dmxdev_init failed: error %d\n",
1449 __FUNCTION__, result); 1449 __FUNCTION__, result);
1450 1450
1451 dvb_dmx_release(&dec->demux); 1451 dvb_dmx_release(&dec->demux);
1452 dvb_unregister_adapter(dec->adapter); 1452 dvb_unregister_adapter(&dec->adapter);
1453 1453
1454 return result; 1454 return result;
1455 } 1455 }
@@ -1463,7 +1463,7 @@ static int ttusb_dec_init_dvb(struct ttusb_dec *dec)
1463 1463
1464 dvb_dmxdev_release(&dec->dmxdev); 1464 dvb_dmxdev_release(&dec->dmxdev);
1465 dvb_dmx_release(&dec->demux); 1465 dvb_dmx_release(&dec->demux);
1466 dvb_unregister_adapter(dec->adapter); 1466 dvb_unregister_adapter(&dec->adapter);
1467 1467
1468 return result; 1468 return result;
1469 } 1469 }
@@ -1476,12 +1476,12 @@ static int ttusb_dec_init_dvb(struct ttusb_dec *dec)
1476 dec->demux.dmx.remove_frontend(&dec->demux.dmx, &dec->frontend); 1476 dec->demux.dmx.remove_frontend(&dec->demux.dmx, &dec->frontend);
1477 dvb_dmxdev_release(&dec->dmxdev); 1477 dvb_dmxdev_release(&dec->dmxdev);
1478 dvb_dmx_release(&dec->demux); 1478 dvb_dmx_release(&dec->demux);
1479 dvb_unregister_adapter(dec->adapter); 1479 dvb_unregister_adapter(&dec->adapter);
1480 1480
1481 return result; 1481 return result;
1482 } 1482 }
1483 1483
1484 dvb_net_init(dec->adapter, &dec->dvb_net, &dec->demux.dmx); 1484 dvb_net_init(&dec->adapter, &dec->dvb_net, &dec->demux.dmx);
1485 1485
1486 return 0; 1486 return 0;
1487} 1487}
@@ -1496,7 +1496,7 @@ static void ttusb_dec_exit_dvb(struct ttusb_dec *dec)
1496 dvb_dmxdev_release(&dec->dmxdev); 1496 dvb_dmxdev_release(&dec->dmxdev);
1497 dvb_dmx_release(&dec->demux); 1497 dvb_dmx_release(&dec->demux);
1498 if (dec->fe) dvb_unregister_frontend(dec->fe); 1498 if (dec->fe) dvb_unregister_frontend(dec->fe);
1499 dvb_unregister_adapter(dec->adapter); 1499 dvb_unregister_adapter(&dec->adapter);
1500} 1500}
1501 1501
1502static void ttusb_dec_exit_rc(struct ttusb_dec *dec) 1502static void ttusb_dec_exit_rc(struct ttusb_dec *dec)
@@ -1620,7 +1620,7 @@ static int ttusb_dec_probe(struct usb_interface *intf,
1620 } 1620 }
1621 ttusb_dec_init_dvb(dec); 1621 ttusb_dec_init_dvb(dec);
1622 1622
1623 dec->adapter->priv = dec; 1623 dec->adapter.priv = dec;
1624 switch (le16_to_cpu(id->idProduct)) { 1624 switch (le16_to_cpu(id->idProduct)) {
1625 case 0x1006: 1625 case 0x1006:
1626 dec->fe = ttusbdecfe_dvbs_attach(&fe_config); 1626 dec->fe = ttusbdecfe_dvbs_attach(&fe_config);
@@ -1637,7 +1637,7 @@ static int ttusb_dec_probe(struct usb_interface *intf,
1637 le16_to_cpu(dec->udev->descriptor.idVendor), 1637 le16_to_cpu(dec->udev->descriptor.idVendor),
1638 le16_to_cpu(dec->udev->descriptor.idProduct)); 1638 le16_to_cpu(dec->udev->descriptor.idProduct));
1639 } else { 1639 } else {
1640 if (dvb_register_frontend(dec->adapter, dec->fe)) { 1640 if (dvb_register_frontend(&dec->adapter, dec->fe)) {
1641 printk("budget-ci: Frontend registration failed!\n"); 1641 printk("budget-ci: Frontend registration failed!\n");
1642 if (dec->fe->ops->release) 1642 if (dec->fe->ops->release)
1643 dec->fe->ops->release(dec->fe); 1643 dec->fe->ops->release(dec->fe);
diff --git a/drivers/media/video/video-buf-dvb.c b/drivers/media/video/video-buf-dvb.c
index 31cc4ed9b747..5f870075b55e 100644
--- a/drivers/media/video/video-buf-dvb.c
+++ b/drivers/media/video/video-buf-dvb.c
@@ -149,10 +149,10 @@ int videobuf_dvb_register(struct videobuf_dvb *dvb,
149 dvb->name, result); 149 dvb->name, result);
150 goto fail_adapter; 150 goto fail_adapter;
151 } 151 }
152 dvb->adapter->priv = adapter_priv; 152 dvb->adapter.priv = adapter_priv;
153 153
154 /* register frontend */ 154 /* register frontend */
155 result = dvb_register_frontend(dvb->adapter, dvb->frontend); 155 result = dvb_register_frontend(&dvb->adapter, dvb->frontend);
156 if (result < 0) { 156 if (result < 0) {
157 printk(KERN_WARNING "%s: dvb_register_frontend failed (errno = %d)\n", 157 printk(KERN_WARNING "%s: dvb_register_frontend failed (errno = %d)\n",
158 dvb->name, result); 158 dvb->name, result);
@@ -178,7 +178,7 @@ int videobuf_dvb_register(struct videobuf_dvb *dvb,
178 dvb->dmxdev.filternum = 256; 178 dvb->dmxdev.filternum = 256;
179 dvb->dmxdev.demux = &dvb->demux.dmx; 179 dvb->dmxdev.demux = &dvb->demux.dmx;
180 dvb->dmxdev.capabilities = 0; 180 dvb->dmxdev.capabilities = 0;
181 result = dvb_dmxdev_init(&dvb->dmxdev, dvb->adapter); 181 result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter);
182 if (result < 0) { 182 if (result < 0) {
183 printk(KERN_WARNING "%s: dvb_dmxdev_init failed (errno = %d)\n", 183 printk(KERN_WARNING "%s: dvb_dmxdev_init failed (errno = %d)\n",
184 dvb->name, result); 184 dvb->name, result);
@@ -209,7 +209,7 @@ int videobuf_dvb_register(struct videobuf_dvb *dvb,
209 } 209 }
210 210
211 /* register network adapter */ 211 /* register network adapter */
212 dvb_net_init(dvb->adapter, &dvb->net, &dvb->demux.dmx); 212 dvb_net_init(&dvb->adapter, &dvb->net, &dvb->demux.dmx);
213 return 0; 213 return 0;
214 214
215fail_fe_conn: 215fail_fe_conn:
@@ -223,7 +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_unregister_adapter(dvb->adapter); 226 dvb_unregister_adapter(&dvb->adapter);
227fail_adapter: 227fail_adapter:
228 return result; 228 return result;
229} 229}
@@ -236,7 +236,7 @@ void videobuf_dvb_unregister(struct videobuf_dvb *dvb)
236 dvb_dmxdev_release(&dvb->dmxdev); 236 dvb_dmxdev_release(&dvb->dmxdev);
237 dvb_dmx_release(&dvb->demux); 237 dvb_dmx_release(&dvb->demux);
238 dvb_unregister_frontend(dvb->frontend); 238 dvb_unregister_frontend(dvb->frontend);
239 dvb_unregister_adapter(dvb->adapter); 239 dvb_unregister_adapter(&dvb->adapter);
240} 240}
241 241
242EXPORT_SYMBOL(videobuf_dvb_register); 242EXPORT_SYMBOL(videobuf_dvb_register);