summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2007-11-16 14:16:59 -0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2007-11-16 14:16:59 -0200
commit08040ce8e8ef34bde02bcbcd7135338b19c25108 (patch)
tree86acd05f36258bf25296c2e85b2d068383ea5a93 /linux/drivers
parentcd2c96baa6952ecab7cadbbf026afa9293d9bd79 (diff)
downloadmediapointer-dvb-s2-08040ce8e8ef34bde02bcbcd7135338b19c25108.tar.gz
mediapointer-dvb-s2-08040ce8e8ef34bde02bcbcd7135338b19c25108.tar.bz2
tm6000: fix tm6000 attach method and fix a few CodingStyles
From: Michel Ludwig <michel.ludwig@gmail.com> Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/staging/tm6000/tm6000-dvb.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/linux/drivers/staging/tm6000/tm6000-dvb.c b/linux/drivers/staging/tm6000/tm6000-dvb.c
index 2849f375c..2aac94111 100644
--- a/linux/drivers/staging/tm6000/tm6000-dvb.c
+++ b/linux/drivers/staging/tm6000/tm6000-dvb.c
@@ -28,6 +28,8 @@
#include <media/tuner.h>
+#include "tuner-xc2028.h"
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
static void tm6000_urb_received(struct urb *urb, struct pt_regs *ptregs)
#else
@@ -235,20 +237,29 @@ int tm6000_dvb_register(struct tm6000_core *dev)
THIS_MODULE, &dev->udev->dev);
dvb->adapter.priv = dev;
- if(dvb->frontend) {
+ if (dvb->frontend) {
+ struct xc2028_config cfg = {
+ .i2c_adap = &dev->i2c_adap,
+ .video_dev = dev,
+ };
+
ret = dvb_register_frontend(&dvb->adapter, dvb->frontend);
- if(ret < 0) {
- printk("tm6000: couldn't register frontend\n");
+ if (ret < 0) {
+ printk(KERN_ERR
+ "tm6000: couldn't register frontend\n");
goto adapter_err;
}
- // attach the tuner like this for now
- tm6000_i2c_call_clients(dev, VIDIOC_INT_DVB_TUNER_ATTACH, dvb->frontend);
-
- printk("tm6000: XC2028/3028 asked to be attached to frontend!\n");
- }
- else {
- printk("tm6000: no frontend found\n");
+ if (!dvb_attach(xc2028_attach, dvb->frontend, &cfg)) {
+ printk(KERN_ERR "tm6000: couldn't register "
+ "frontend (xc3028)\n");
+ ret = -EINVAL;
+ goto adapter_err;
+ }
+ printk(KERN_INFO "tm6000: XC2028/3028 asked to be "
+ "attached to frontend!\n");
+ } else {
+ printk(KERN_ERR "tm6000: no frontend found\n");
}
dvb->demux.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING
@@ -282,6 +293,9 @@ dvb_dmx_err:
frontend_err:
if(dvb->frontend) {
dvb_unregister_frontend(dvb->frontend);
+#ifdef CONFIG_DVB_CORE_ATTACH
+ symbol_put(xc3028_attach);
+#endif
}
adapter_err:
dvb_unregister_adapter(&dvb->adapter);