X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fmedia%2Fvideo%2Fcx231xx%2Fcx231xx-i2c.c;fp=drivers%2Fmedia%2Fvideo%2Fcx231xx%2Fcx231xx-i2c.c;h=835670623dfbc4540b28d5d51eee0d6223cc4b9e;hb=f2ec334db8d14ae3ec2e4bf8d974f75b8f772e26;hp=58d9cc0867b9a43bcc7240e8e578041cadbe87e0;hpb=81e20d4d8d0317ecf1c7d193a52ab26cf74e1737;p=mv-sheeva.git diff --git a/drivers/media/video/cx231xx/cx231xx-i2c.c b/drivers/media/video/cx231xx/cx231xx-i2c.c index 58d9cc0867b..835670623df 100644 --- a/drivers/media/video/cx231xx/cx231xx-i2c.c +++ b/drivers/media/video/cx231xx/cx231xx-i2c.c @@ -359,7 +359,7 @@ static int cx231xx_i2c_xfer(struct i2c_adapter *i2c_adap, if (num <= 0) return 0; - + mutex_lock(&dev->i2c_lock); for (i = 0; i < num; i++) { addr = msgs[i].addr >> 1; @@ -372,6 +372,7 @@ static int cx231xx_i2c_xfer(struct i2c_adapter *i2c_adap, rc = cx231xx_i2c_check_for_device(i2c_adap, &msgs[i]); if (rc < 0) { dprintk2(2, " no device\n"); + mutex_unlock(&dev->i2c_lock); return rc; } @@ -384,7 +385,7 @@ static int cx231xx_i2c_xfer(struct i2c_adapter *i2c_adap, } } else if (i + 1 < num && (msgs[i + 1].flags & I2C_M_RD) && msgs[i].addr == msgs[i + 1].addr - && (msgs[i].len <= 2) && (bus->nr < 2)) { + && (msgs[i].len <= 2) && (bus->nr < 3)) { /* read bytes */ rc = cx231xx_i2c_recv_bytes_with_saddr(i2c_adap, &msgs[i], @@ -407,10 +408,11 @@ static int cx231xx_i2c_xfer(struct i2c_adapter *i2c_adap, if (i2c_debug >= 2) printk("\n"); } - + mutex_unlock(&dev->i2c_lock); return num; err: dprintk2(2, " ERROR: %i\n", rc); + mutex_unlock(&dev->i2c_lock); return rc; } @@ -507,9 +509,6 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus) if (0 == bus->i2c_rc) { if (i2c_scan) cx231xx_do_i2c_scan(dev, &bus->i2c_client); - - /* Instantiate the IR receiver device, if present */ - cx231xx_register_i2c_ir(dev); } else cx231xx_warn("%s: i2c bus %d register FAILED\n", dev->name, bus->nr);