summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/video-buf-dvb.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/video-buf-dvb.c')
-rw-r--r--linux/drivers/media/video/video-buf-dvb.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/linux/drivers/media/video/video-buf-dvb.c b/linux/drivers/media/video/video-buf-dvb.c
index e8eb03255..9473d430a 100644
--- a/linux/drivers/media/video/video-buf-dvb.c
+++ b/linux/drivers/media/video/video-buf-dvb.c
@@ -1,5 +1,5 @@
/*
- * $Id: video-buf-dvb.c,v 1.2 2004/10/20 09:43:34 kraxel Exp $
+ * $Id: video-buf-dvb.c,v 1.3 2004/10/20 17:44:24 kraxel Exp $
*
* some helper function for simple DVB cards which simply DMA the
* complete transport stream and let the computer sort everything else
@@ -140,6 +140,23 @@ int videobuf_dvb_register(struct videobuf_dvb *dvb)
init_MUTEX(&dvb->lock);
+ /* register adapter */
+ result = dvb_register_adapter(&dvb->adapter, dvb->name, THIS_MODULE);
+ if (result < 0) {
+ printk(KERN_WARNING "%s: dvb_register_adapter failed (errno = %d)\n",
+ dvb->name, result);
+ goto fail_adapter;
+ }
+
+ /* register frontend */
+ result = dvb_register_frontend(dvb->adapter, dvb->frontend);
+ if (result < 0) {
+ printk(KERN_WARNING "%s: dvb_register_frontend failed (errno = %d)\n",
+ dvb->name, result);
+ goto fail_frontend;
+ }
+
+ /* register demux stuff */
dvb->demux.dmx.capabilities =
DMX_TS_FILTERING | DMX_SECTION_FILTERING |
DMX_MEMORY_BASED_FILTERING;
@@ -188,6 +205,7 @@ int videobuf_dvb_register(struct videobuf_dvb *dvb)
goto fail_fe_conn;
}
+ /* register network adapter */
dvb_net_init(dvb->adapter, &dvb->net, &dvb->demux.dmx);
return 0;
@@ -200,6 +218,10 @@ fail_fe_hw:
fail_dmxdev:
dvb_dmx_release(&dvb->demux);
fail_dmx:
+ dvb_unregister_frontend(dvb->frontend);
+fail_frontend:
+ dvb_unregister_adapter(dvb->adapter);
+fail_adapter:
return result;
}
@@ -210,6 +232,8 @@ void videobuf_dvb_unregister(struct videobuf_dvb *dvb)
dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_hw);
dvb_dmxdev_release(&dvb->dmxdev);
dvb_dmx_release(&dvb->demux);
+ dvb_unregister_frontend(dvb->frontend);
+ dvb_unregister_adapter(dvb->adapter);
}
EXPORT_SYMBOL(videobuf_dvb_register);