diff options
author | Johannes Stezenbach <js@linuxtv.org> | 2005-05-17 00:54:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-17 10:59:33 -0400 |
commit | fdc53a6dbfea18e621dd23ed5cfb160837d7ce52 (patch) | |
tree | 9ce191cdb07264f8c6275c1443e61b465e17d0cb /drivers/media/dvb/ttusb-dec/ttusb_dec.c | |
parent | 0b3f5a57bf110b519b706365c86ada199075f34e (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/dvb/ttusb-dec/ttusb_dec.c')
-rw-r--r-- | drivers/media/dvb/ttusb-dec/ttusb_dec.c | 20 |
1 files changed, 10 insertions, 10 deletions
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 | ||
1502 | static void ttusb_dec_exit_rc(struct ttusb_dec *dec) | 1502 | static 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); |