summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/adv7180.c
diff options
context:
space:
mode:
authorLars-Peter Clausen2014-03-07 17:14:27 +0100
committerMauro Carvalho Chehab2014-03-11 14:21:55 +0100
commit297a0ae32bf84c8ae135971eb21f18ee5f4ca3ea (patch)
treea362ae7b165981172ccdc428a9f37a18ff9e34c6 /drivers/media/i2c/adv7180.c
parent[media] DocBook v4l2: update the G/S_EDID documentation (diff)
downloadkernel-qcow2-linux-297a0ae32bf84c8ae135971eb21f18ee5f4ca3ea.tar.gz
kernel-qcow2-linux-297a0ae32bf84c8ae135971eb21f18ee5f4ca3ea.tar.xz
kernel-qcow2-linux-297a0ae32bf84c8ae135971eb21f18ee5f4ca3ea.zip
[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/adv7180.c')
-rw-r--r--drivers/media/i2c/adv7180.c4
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,
err_free_ctrl:
adv7180_exit_controls(state);
err_unreg_subdev:
- mutex_destroy(&state->mutex);
v4l2_device_unregister_subdev(sd);
+ mutex_destroy(&state->mutex);
err:
printk(KERN_ERR KBUILD_MODNAME ": Failed to probe: %d\n", ret);
return ret;
@@ -640,8 +640,8 @@ static int adv7180_remove(struct i2c_client *client)
}
}
- mutex_destroy(&state->mutex);
v4l2_device_unregister_subdev(sd);
+ mutex_destroy(&state->mutex);
return 0;
}