aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/adv7343.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/i2c/adv7343.c')
-rw-r--r--drivers/media/i2c/adv7343.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/media/i2c/adv7343.c b/drivers/media/i2c/adv7343.c
index 7606218ec4a7..8080c2cf1029 100644
--- a/drivers/media/i2c/adv7343.c
+++ b/drivers/media/i2c/adv7343.c
@@ -27,6 +27,7 @@
27#include <linux/uaccess.h> 27#include <linux/uaccess.h>
28 28
29#include <media/adv7343.h> 29#include <media/adv7343.h>
30#include <media/v4l2-async.h>
30#include <media/v4l2-device.h> 31#include <media/v4l2-device.h>
31#include <media/v4l2-ctrls.h> 32#include <media/v4l2-ctrls.h>
32 33
@@ -445,16 +446,21 @@ static int adv7343_probe(struct i2c_client *client,
445 ADV7343_GAIN_DEF); 446 ADV7343_GAIN_DEF);
446 state->sd.ctrl_handler = &state->hdl; 447 state->sd.ctrl_handler = &state->hdl;
447 if (state->hdl.error) { 448 if (state->hdl.error) {
448 int err = state->hdl.error; 449 err = state->hdl.error;
449 450 goto done;
450 v4l2_ctrl_handler_free(&state->hdl);
451 return err;
452 } 451 }
453 v4l2_ctrl_handler_setup(&state->hdl); 452 v4l2_ctrl_handler_setup(&state->hdl);
454 453
455 err = adv7343_initialize(&state->sd); 454 err = adv7343_initialize(&state->sd);
456 if (err) 455 if (err)
456 goto done;
457
458 err = v4l2_async_register_subdev(&state->sd);
459
460done:
461 if (err < 0)
457 v4l2_ctrl_handler_free(&state->hdl); 462 v4l2_ctrl_handler_free(&state->hdl);
463
458 return err; 464 return err;
459} 465}
460 466
@@ -463,6 +469,7 @@ static int adv7343_remove(struct i2c_client *client)
463 struct v4l2_subdev *sd = i2c_get_clientdata(client); 469 struct v4l2_subdev *sd = i2c_get_clientdata(client);
464 struct adv7343_state *state = to_state(sd); 470 struct adv7343_state *state = to_state(sd);
465 471
472 v4l2_async_unregister_subdev(&state->sd);
466 v4l2_device_unregister_subdev(sd); 473 v4l2_device_unregister_subdev(sd);
467 v4l2_ctrl_handler_free(&state->hdl); 474 v4l2_ctrl_handler_free(&state->hdl);
468 475