aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx18/cx18-i2c.c')
-rw-r--r--drivers/media/video/cx18/cx18-i2c.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/media/video/cx18/cx18-i2c.c b/drivers/media/video/cx18/cx18-i2c.c
index b9b7064a2be8..8591e4fc359f 100644
--- a/drivers/media/video/cx18/cx18-i2c.c
+++ b/drivers/media/video/cx18/cx18-i2c.c
@@ -211,7 +211,7 @@ static struct i2c_algo_bit_data cx18_i2c_algo_template = {
211/* init + register i2c algo-bit adapter */ 211/* init + register i2c algo-bit adapter */
212int init_cx18_i2c(struct cx18 *cx) 212int init_cx18_i2c(struct cx18 *cx)
213{ 213{
214 int i; 214 int i, err;
215 CX18_DEBUG_I2C("i2c init\n"); 215 CX18_DEBUG_I2C("i2c init\n");
216 216
217 for (i = 0; i < 2; i++) { 217 for (i = 0; i < 2; i++) {
@@ -268,8 +268,18 @@ int init_cx18_i2c(struct cx18 *cx)
268 cx18_call_hw(cx, CX18_HW_GPIO_RESET_CTRL, 268 cx18_call_hw(cx, CX18_HW_GPIO_RESET_CTRL,
269 core, reset, (u32) CX18_GPIO_RESET_I2C); 269 core, reset, (u32) CX18_GPIO_RESET_I2C);
270 270
271 return i2c_bit_add_bus(&cx->i2c_adap[0]) || 271 err = i2c_bit_add_bus(&cx->i2c_adap[0]);
272 i2c_bit_add_bus(&cx->i2c_adap[1]); 272 if (err)
273 goto err;
274 err = i2c_bit_add_bus(&cx->i2c_adap[1]);
275 if (err)
276 goto err_del_bus_0;
277 return 0;
278
279 err_del_bus_0:
280 i2c_del_adapter(&cx->i2c_adap[0]);
281 err:
282 return err;
273} 283}
274 284
275void exit_cx18_i2c(struct cx18 *cx) 285void exit_cx18_i2c(struct cx18 *cx)