diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-03-07 11:14:32 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-03-11 09:26:15 -0400 |
commit | fa5b7945aefdbcd4419f0b8872ce67866d8071e3 (patch) | |
tree | b92c521696a5e87b72ed9b8dda7b08b287a407a9 | |
parent | 0c25534d456535a879aba482dc14795213312514 (diff) |
[media] adv7180: Add support for async device registration
Add support for async device registration to the adv7180 driver.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/media/i2c/adv7180.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c index c750aaee74e1..623cec5c5eb9 100644 --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c | |||
@@ -597,8 +597,16 @@ static int adv7180_probe(struct i2c_client *client, | |||
597 | ret = init_device(client, state); | 597 | ret = init_device(client, state); |
598 | if (ret) | 598 | if (ret) |
599 | goto err_free_ctrl; | 599 | goto err_free_ctrl; |
600 | |||
601 | ret = v4l2_async_register_subdev(sd); | ||
602 | if (ret) | ||
603 | goto err_free_irq; | ||
604 | |||
600 | return 0; | 605 | return 0; |
601 | 606 | ||
607 | err_free_irq: | ||
608 | if (state->irq > 0) | ||
609 | free_irq(client->irq, state); | ||
602 | err_free_ctrl: | 610 | err_free_ctrl: |
603 | adv7180_exit_controls(state); | 611 | adv7180_exit_controls(state); |
604 | err_unreg_subdev: | 612 | err_unreg_subdev: |
@@ -612,6 +620,8 @@ static int adv7180_remove(struct i2c_client *client) | |||
612 | struct v4l2_subdev *sd = i2c_get_clientdata(client); | 620 | struct v4l2_subdev *sd = i2c_get_clientdata(client); |
613 | struct adv7180_state *state = to_state(sd); | 621 | struct adv7180_state *state = to_state(sd); |
614 | 622 | ||
623 | v4l2_async_unregister_subdev(sd); | ||
624 | |||
615 | if (state->irq > 0) | 625 | if (state->irq > 0) |
616 | free_irq(client->irq, state); | 626 | free_irq(client->irq, state); |
617 | 627 | ||