summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Benesch <twoof7@freenet.de>2009-11-28 15:06:30 +0100
committerMatthias Benesch <twoof7@freenet.de>2009-12-08 21:35:34 +0100
commit4b77b01f3e921ca38b2070476e9d3e3c4af1aca1 (patch)
tree23495543c39530eca41acd3b3f91ec4608c073ad
parentb72dc3e69581dc239e7497c7059c1889355a08d3 (diff)
downloadmediapointer-dvb-s2-4b77b01f3e921ca38b2070476e9d3e3c4af1aca1.tar.gz
mediapointer-dvb-s2-4b77b01f3e921ca38b2070476e9d3e3c4af1aca1.tar.bz2
Changes to enable unloading of module ngene.
From: Matthias Benesch <twoof7@freenet.de> Added changes from @pram to enable unloading of module ngene. Priority: normal
-rw-r--r--linux/drivers/media/video/ngene/ngene-core.c20
-rw-r--r--linux/drivers/media/video/ngene/ngene.h2
2 files changed, 17 insertions, 5 deletions
diff --git a/linux/drivers/media/video/ngene/ngene-core.c b/linux/drivers/media/video/ngene/ngene-core.c
index c9955f3ee..ad02fa16c 100644
--- a/linux/drivers/media/video/ngene/ngene-core.c
+++ b/linux/drivers/media/video/ngene/ngene-core.c
@@ -1955,6 +1955,7 @@ static int ngene_start_feed(struct dvb_demux_feed *dvbdmxfeed)
{
struct dvb_demux *dvbdmx=dvbdmxfeed->demux;
struct ngene_channel *chan=dvbdmx->priv;
+#ifdef NGENE_COMMAND_API
struct ngene *dev=chan->dev;
if (dev->card_info->io_type[chan->number]&NGENE_IO_TSOUT) {
@@ -1979,6 +1980,7 @@ static int ngene_start_feed(struct dvb_demux_feed *dvbdmxfeed)
}
}
+#endif
if (chan->users==0) {
set_transfer(chan, 1);
@@ -1992,6 +1994,7 @@ static int ngene_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
{
struct dvb_demux *dvbdmx=dvbdmxfeed->demux;
struct ngene_channel *chan=dvbdmx->priv;
+#ifdef NGENE_COMMAND_API
struct ngene *dev=chan->dev;
if (dev->card_info->io_type[chan->number]&NGENE_IO_TSOUT) {
@@ -2011,6 +2014,7 @@ static int ngene_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
}
}
+#endif
if (--chan->users)
return chan->users;
@@ -3206,6 +3210,7 @@ ssize_t video_read(struct file *file, char *buf, size_t count, loff_t *ppos)
/* Why is this not exported from dvb_core ?!?! */
+#ifdef NGENE_COMMAND_API
static int dvb_usercopy2(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg,
int (*func)(struct inode *inode, struct file *file,
@@ -3307,6 +3312,7 @@ static int video_ioctl(struct inode *inode, struct file *file,
{
return dvb_usercopy2(inode, file, cmd, arg, video_do_ioctl);
}
+#endif
static struct file_operations video_fops = {
.owner= THIS_MODULE,
@@ -3314,7 +3320,9 @@ static struct file_operations video_fops = {
.write= video_write,
.open= video_open,
.release= video_release,
+#ifdef NGENE_COMMAND_API
.ioctl= video_ioctl,
+#endif
};
static struct dvb_device dvbdev_video = {
@@ -3740,7 +3748,7 @@ static void release_channel(struct ngene_channel *chan)
dvb_unregister_device(chan->video_dev);
if (chan->fe) {
dvb_unregister_frontend(chan->fe);
- /*dvb_frontend_detach(chan->fe);*/
+ dvb_frontend_detach(chan->fe);
chan->fe=0;
}
dvbdemux->dmx.close(&dvbdemux->dmx);
@@ -3919,8 +3927,10 @@ static int __devinit ngene_probe(struct pci_dev *pci_dev,
return -ENODEV;
dev=vmalloc(sizeof(struct ngene));
- if (dev==NULL)
- return -ENOMEM;
+ if (dev==NULL) {
+ stat = -ENOMEM;
+ goto fail0;
+ }
memset(dev, 0, sizeof(struct ngene));
dev->pci_dev=pci_dev;
@@ -3991,6 +4001,8 @@ fail2:
ngene_stop(dev);
fail1:
ngene_release_buffers(dev);
+fail0:
+ pci_disable_device(pci_dev);
pci_set_drvdata(pci_dev, 0);
return stat;
}
@@ -4471,7 +4483,7 @@ static struct pci_driver ngene_pci_driver = {
.name = "ngene",
.id_table = ngene_id_tbl,
.probe = ngene_probe,
- .remove = ngene_remove,
+ .remove = __devexit_p(ngene_remove),
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
.err_handler = &ngene_errors,
#endif
diff --git a/linux/drivers/media/video/ngene/ngene.h b/linux/drivers/media/video/ngene/ngene.h
index 7f0637fdf..4c59646f3 100644
--- a/linux/drivers/media/video/ngene/ngene.h
+++ b/linux/drivers/media/video/ngene/ngene.h
@@ -25,7 +25,7 @@
#define _NGENE_H_
//#define ONE_ADAPTER
-#define NGENE_COMMAND_API
+//#define NGENE_COMMAND_API
#define NGENE_STV090X
//#define NGENE_V4L