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-budget | |
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-budget')
-rw-r--r-- | drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 20 |
1 files changed, 10 insertions, 10 deletions
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 | ||