diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-03-07 11:14:27 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-03-11 09:21:55 -0400 |
commit | 297a0ae32bf84c8ae135971eb21f18ee5f4ca3ea (patch) | |
tree | a362ae7b165981172ccdc428a9f37a18ff9e34c6 /drivers/media/i2c | |
parent | e25436581f4117a0df9bf5539f6a7702a78df317 (diff) |
[media] adv7180: Fix remove order
The mutex is used in the subdev callbacks, so unregister the subdev before the
mutex is destroyed.
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>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r-- | drivers/media/i2c/adv7180.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c index d7d99f1c69e4..1a3622a9d0fb 100644 --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c | |||
@@ -616,8 +616,8 @@ static int adv7180_probe(struct i2c_client *client, | |||
616 | err_free_ctrl: | 616 | err_free_ctrl: |
617 | adv7180_exit_controls(state); | 617 | adv7180_exit_controls(state); |
618 | err_unreg_subdev: | 618 | err_unreg_subdev: |
619 | mutex_destroy(&state->mutex); | ||
620 | v4l2_device_unregister_subdev(sd); | 619 | v4l2_device_unregister_subdev(sd); |
620 | mutex_destroy(&state->mutex); | ||
621 | err: | 621 | err: |
622 | printk(KERN_ERR KBUILD_MODNAME ": Failed to probe: %d\n", ret); | 622 | printk(KERN_ERR KBUILD_MODNAME ": Failed to probe: %d\n", ret); |
623 | return ret; | 623 | return ret; |
@@ -640,8 +640,8 @@ static int adv7180_remove(struct i2c_client *client) | |||
640 | } | 640 | } |
641 | } | 641 | } |
642 | 642 | ||
643 | mutex_destroy(&state->mutex); | ||
644 | v4l2_device_unregister_subdev(sd); | 643 | v4l2_device_unregister_subdev(sd); |
644 | mutex_destroy(&state->mutex); | ||
645 | return 0; | 645 | return 0; |
646 | } | 646 | } |
647 | 647 | ||