summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorMichael Hunold <devnull@localhost>2004-03-31 09:55:31 +0000
committerMichael Hunold <devnull@localhost>2004-03-31 09:55:31 +0000
commitd4c06b410b65a258a055d8edb0c6935d0b1f8f6f (patch)
tree06a56f1eb821f74eb4a0b1138f230c35dbdbe5ca /linux/drivers
parent23edf6c1a2c8a0644077bd8f3960a262985d7065 (diff)
downloadmediapointer-dvb-s2-d4c06b410b65a258a055d8edb0c6935d0b1f8f6f.tar.gz
mediapointer-dvb-s2-d4c06b410b65a258a055d8edb0c6935d0b1f8f6f.tar.bz2
- first try to fix the module use count bugs, thanks to Hernan A.Perez Masci for his work!
- dvb_net most likely doesn't work with 2.6 yet and dvb_net is untested in general
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/dvb/b2c2/skystar2.c2
-rw-r--r--linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c2
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_net.c9
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvbdev.c7
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvbdev.h4
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c2
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-core.c2
-rw-r--r--linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c3
-rw-r--r--linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c2
9 files changed, 22 insertions, 11 deletions
diff --git a/linux/drivers/media/dvb/b2c2/skystar2.c b/linux/drivers/media/dvb/b2c2/skystar2.c
index deea58509..59f595f68 100644
--- a/linux/drivers/media/dvb/b2c2/skystar2.c
+++ b/linux/drivers/media/dvb/b2c2/skystar2.c
@@ -2243,7 +2243,7 @@ static int skystar2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (driver_initialize(pdev) != 0)
return -ENODEV;
- dvb_register_adapter(&dvb_adapter, skystar2_pci_driver.name);
+ dvb_register_adapter(&dvb_adapter, skystar2_pci_driver.name, THIS_MODULE);
if (dvb_adapter == NULL) {
printk("%s: Error registering DVB adapter\n", __FUNCTION__);
diff --git a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index 9925456b5..090fc25f5 100644
--- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -321,7 +321,7 @@ static int __init dvb_bt8xx_load_card( struct dvb_bt8xx_card *card)
}
- if ((result = dvb_register_adapter(&card->dvb_adapter, card->card_name)) < 0) {
+ if ((result = dvb_register_adapter(&card->dvb_adapter, card->card_name, THIS_MODULE)) < 0) {
printk("dvb_bt8xx: dvb_register_adapter failed (errno = %d)\n", result);
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_net.c b/linux/drivers/media/dvb/dvb-core/dvb_net.c
index 2d4e65e91..427c314e3 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_net.c
@@ -46,6 +46,7 @@ struct dvb_net_priv {
struct net_device_stats stats;
char name[6];
u16 pid;
+ struct dvb_net *host;
struct dmx_demux *demux;
struct dmx_section_feed *secfeed;
struct dmx_section_filter *secfilter;
@@ -469,6 +470,8 @@ static int dvb_net_init_dev (struct net_device *dev)
static void dvb_net_setup(struct net_device *dev)
#endif
{
+ struct dvb_net_priv *priv = (struct dvb_net_priv*)dev->priv;
+
ether_setup(dev);
dev->open = dvb_net_open;
@@ -481,7 +484,8 @@ static void dvb_net_setup(struct net_device *dev)
dev->mtu = 4096;
dev->mc_count = 0;
dev->hard_header_cache = NULL;
-
+ dev->owner = priv->host->dvbdev->adapter->module;
+
dev->flags |= IFF_NOARP;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
return 0;
@@ -536,7 +540,8 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid)
priv->demux = demux;
priv->pid = pid;
priv->rx_mode = RX_MODE_UNI;
-
+ priv->host = dvbnet;
+
INIT_WORK(&priv->set_multicast_list_wq, wq_set_multicast_list, net);
INIT_WORK(&priv->restart_net_feed_wq, wq_restart_net_feed, net);
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c
index bcfb827d4..9f6a63714 100644
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c
@@ -220,6 +220,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
dvbdev->adapter = adap;
dvbdev->priv = priv;
+ dvbdev->fops->owner = adap->module;
+
list_add_tail (&dvbdev->list_head, &adap->device_list);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
@@ -246,6 +248,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
nums2minor(adap->num, type, id));
#endif
+
+
return 0;
}
@@ -287,7 +291,7 @@ skip:
}
-int dvb_register_adapter(struct dvb_adapter **padap, const char *name)
+int dvb_register_adapter(struct dvb_adapter **padap, const char *name, struct module *module)
{
struct dvb_adapter *adap;
int num;
@@ -321,6 +325,7 @@ int dvb_register_adapter(struct dvb_adapter **padap, const char *name)
#endif
adap->num = num;
adap->name = name;
+ adap->module = module;
list_add_tail (&adap->list_head, &dvb_adapter_list);
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.h b/linux/drivers/media/dvb/dvb-core/dvbdev.h
index 22e20f340..cd0550b8f 100644
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.h
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.h
@@ -52,6 +52,8 @@ struct dvb_adapter {
struct list_head device_list;
const char *name;
u8 proposed_mac [6];
+
+ struct module *module;
};
@@ -79,7 +81,7 @@ struct dvb_device {
};
-extern int dvb_register_adapter (struct dvb_adapter **padap, const char *name);
+extern int dvb_register_adapter (struct dvb_adapter **padap, const char *name, struct module *module);
extern int dvb_unregister_adapter (struct dvb_adapter *adap);
extern int dvb_register_device (struct dvb_adapter *adap,
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
index 72b45e9a0..478aaf5bc 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -1361,7 +1361,7 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d
return ret;
}
- dvb_register_adapter(&av7110->dvb_adapter, av7110->card_name);
+ dvb_register_adapter(&av7110->dvb_adapter, av7110->card_name, THIS_MODULE);
/* the Siemens DVB needs this if you want to have the i2c chips
get recognized before the main driver is fully loaded */
diff --git a/linux/drivers/media/dvb/ttpci/budget-core.c b/linux/drivers/media/dvb/ttpci/budget-core.c
index 52974ebe5..302a3495c 100644
--- a/linux/drivers/media/dvb/ttpci/budget-core.c
+++ b/linux/drivers/media/dvb/ttpci/budget-core.c
@@ -267,7 +267,7 @@ int ttpci_budget_init (struct budget *budget,
budget->card = bi;
budget->dev = (struct saa7146_dev *) dev;
- dvb_register_adapter(&budget->dvb_adapter, budget->card->name);
+ dvb_register_adapter(&budget->dvb_adapter, budget->card->name, THIS_MODULE);
/* set dd1 stream a & b */
saa7146_write(dev, DD1_STREAM_B, 0x00000000);
diff --git a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index fadb850e0..7599e0b2e 100644
--- a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -1142,8 +1142,7 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
up(&ttusb->sem);
- dvb_register_adapter(&ttusb->adapter,
- "Technotrend/Hauppauge Nova-USB");
+ dvb_register_adapter(&ttusb->adapter, "Technotrend/Hauppauge Nova-USB", THIS_MODULE);
dvb_register_i2c_bus(ttusb_i2c_xfer, ttusb, ttusb->adapter, 0);
dvb_add_frontend_ioctls(ttusb->adapter, ttusb_lnb_ioctl, NULL,
diff --git a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
index d15af99b4..37661519c 100644
--- a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -1379,7 +1379,7 @@ static int ttusb_dec_init_dvb(struct ttusb_dec *dec)
dprintk("%s\n", __FUNCTION__);
if ((result = dvb_register_adapter(&dec->adapter,
- dec->model_name)) < 0) {
+ dec->model_name, THIS_MODULE)) < 0) {
printk("%s: dvb_register_adapter failed: error %d\n",
__FUNCTION__, result);