]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/dvb/dvb-usb/digitv.c
[PATCH] USB: new devices for the Option driver
[linux-2.6-omap-h63xx.git] / drivers / media / dvb / dvb-usb / digitv.c
index e6c55c9c9417d2afe8bf67a0b906c0342548f56c..91136c00ce9ddf5bf3b5d1957601c05d0148decc 100644 (file)
@@ -48,7 +48,7 @@ static int digitv_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num
        struct dvb_usb_device *d = i2c_get_adapdata(adap);
        int i;
 
-       if (down_interruptible(&d->i2c_sem) < 0)
+       if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
                return -EAGAIN;
 
        if (num > 2)
@@ -67,7 +67,7 @@ static int digitv_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num
                                break;
        }
 
-       up(&d->i2c_sem);
+       mutex_unlock(&d->i2c_mutex);
        return i;
 }
 
@@ -175,11 +175,13 @@ static int digitv_probe(struct usb_interface *intf,
        if ((ret = dvb_usb_device_init(intf,&digitv_properties,THIS_MODULE,&d)) == 0) {
                u8 b[4] = { 0 };
 
-               b[0] = 1;
-               digitv_ctrl_msg(d,USB_WRITE_REMOTE_TYPE,0,b,4,NULL,0);
+               if (d != NULL) { /* do that only when the firmware is loaded */
+                       b[0] = 1;
+                       digitv_ctrl_msg(d,USB_WRITE_REMOTE_TYPE,0,b,4,NULL,0);
 
-               b[0] = 0;
-               digitv_ctrl_msg(d,USB_WRITE_REMOTE,0,b,4,NULL,0);
+                       b[0] = 0;
+                       digitv_ctrl_msg(d,USB_WRITE_REMOTE,0,b,4,NULL,0);
+               }
        }
        return ret;
 }
@@ -194,7 +196,7 @@ static struct dvb_usb_properties digitv_properties = {
        .caps = DVB_USB_IS_AN_I2C_ADAPTER,
 
        .usb_ctrl = CYPRESS_FX2,
-       .firmware = "dvb-usb-digitv-01.fw",
+       .firmware = "dvb-usb-digitv-02.fw",
 
        .size_of_priv     = 0,
 
@@ -229,6 +231,7 @@ static struct dvb_usb_properties digitv_properties = {
                        { &digitv_table[0], NULL },
                        { NULL },
                },
+               { NULL },
        }
 };