summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx18/cx18-i2c.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-05-25 10:30:47 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-05-25 10:30:47 -0300
commit7db75cc5ef77d21e53de84182dddeddfb20c5c2f (patch)
tree7eaa3cf61a6e67c3d2032df808def1239845a643 /linux/drivers/media/video/cx18/cx18-i2c.c
parent2da5cdaefead4beb36671ca025826f9e8deadef4 (diff)
parent8ac09cada9b0181fface833be0b9105cb0324717 (diff)
downloadmediapointer-dvb-s2-7db75cc5ef77d21e53de84182dddeddfb20c5c2f.tar.gz
mediapointer-dvb-s2-7db75cc5ef77d21e53de84182dddeddfb20c5c2f.tar.bz2
merge: http://linuxtv.org/hg/~pinchartl/uvcvideo/
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/cx18/cx18-i2c.c')
-rw-r--r--linux/drivers/media/video/cx18/cx18-i2c.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-i2c.c b/linux/drivers/media/video/cx18/cx18-i2c.c
index 4bf737849..3c76a1e27 100644
--- a/linux/drivers/media/video/cx18/cx18-i2c.c
+++ b/linux/drivers/media/video/cx18/cx18-i2c.c
@@ -214,7 +214,7 @@ static struct i2c_algo_bit_data cx18_i2c_algo_template = {
/* init + register i2c algo-bit adapter */
int init_cx18_i2c(struct cx18 *cx)
{
- int i;
+ int i, err;
CX18_DEBUG_I2C("i2c init\n");
for (i = 0; i < 2; i++) {
@@ -273,8 +273,18 @@ int init_cx18_i2c(struct cx18 *cx)
cx18_call_hw(cx, CX18_HW_GPIO_RESET_CTRL,
core, reset, (u32) CX18_GPIO_RESET_I2C);
- return i2c_bit_add_bus(&cx->i2c_adap[0]) ||
- i2c_bit_add_bus(&cx->i2c_adap[1]);
+ err = i2c_bit_add_bus(&cx->i2c_adap[0]);
+ if (err)
+ goto err;
+ err = i2c_bit_add_bus(&cx->i2c_adap[1]);
+ if (err)
+ goto err_del_bus_0;
+ return 0;
+
+ err_del_bus_0:
+ i2c_del_adapter(&cx->i2c_adap[0]);
+ err:
+ return err;
}
void exit_cx18_i2c(struct cx18 *cx)