aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDevin Heitmueller <devin.heitmueller@gmail.com>2008-10-06 11:07:48 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 07:37:14 -0400
commit79025a9ed9132880d5197611dec6d8533c121ac7 (patch)
treeace0f2271fe0342f513566684add9df9367a79fc /drivers
parentda703d6262b5d168a4ceb427255cfcf3771b8f96 (diff)
V4L/DVB (9114): dib0700: fix bad assignment of dib0700_xc5000_tuner_callback after return call
Put callback definition before function return and cleanup callback: Fix a bug where the xc5000 callback was being set *after* the return call (essentially resulting in dead code). Also cleanup the callback function to detect unknown commands. Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700_devices.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index 9891ca0924a3..0cfccc24b190 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -1181,11 +1181,16 @@ static int dib0700_xc5000_tuner_callback(void *priv, int component,
1181{ 1181{
1182 struct dvb_usb_adapter *adap = priv; 1182 struct dvb_usb_adapter *adap = priv;
1183 1183
1184 /* Reset the tuner */ 1184 if (command == XC5000_TUNER_RESET) {
1185 dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 0); 1185 /* Reset the tuner */
1186 msleep(330); /* from Windows USB trace */ 1186 dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 0);
1187 dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 1); 1187 msleep(330); /* from Windows USB trace */
1188 msleep(330); /* from Windows USB trace */ 1188 dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 1);
1189 msleep(330); /* from Windows USB trace */
1190 } else {
1191 err("xc5000: unknown tuner callback command: %d\n", command);
1192 return -EINVAL;
1193 }
1189 1194
1190 return 0; 1195 return 0;
1191} 1196}
@@ -1197,12 +1202,12 @@ static struct xc5000_config s5h1411_xc5000_tunerconfig = {
1197 1202
1198static int xc5000_tuner_attach(struct dvb_usb_adapter *adap) 1203static int xc5000_tuner_attach(struct dvb_usb_adapter *adap)
1199{ 1204{
1205 /* FIXME: generalize & move to common area */
1206 adap->fe->callback = dib0700_xc5000_tuner_callback;
1207
1200 return dvb_attach(xc5000_attach, adap->fe, &adap->dev->i2c_adap, 1208 return dvb_attach(xc5000_attach, adap->fe, &adap->dev->i2c_adap,
1201 &s5h1411_xc5000_tunerconfig) 1209 &s5h1411_xc5000_tunerconfig)
1202 == NULL ? -ENODEV : 0; 1210 == NULL ? -ENODEV : 0;
1203
1204 /* FIXME: generalize & move to common area */
1205 adap->fe->callback = dib0700_xc5000_tuner_callback;
1206} 1211}
1207 1212
1208/* DVB-USB and USB stuff follows */ 1213/* DVB-USB and USB stuff follows */