[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>
This commit is contained in:
parent
e25436581f
commit
297a0ae32b
1 changed files with 2 additions and 2 deletions
|
@ -616,8 +616,8 @@ static int adv7180_probe(struct i2c_client *client,
|
||||||
err_free_ctrl:
|
err_free_ctrl:
|
||||||
adv7180_exit_controls(state);
|
adv7180_exit_controls(state);
|
||||||
err_unreg_subdev:
|
err_unreg_subdev:
|
||||||
mutex_destroy(&state->mutex);
|
|
||||||
v4l2_device_unregister_subdev(sd);
|
v4l2_device_unregister_subdev(sd);
|
||||||
|
mutex_destroy(&state->mutex);
|
||||||
err:
|
err:
|
||||||
printk(KERN_ERR KBUILD_MODNAME ": Failed to probe: %d\n", ret);
|
printk(KERN_ERR KBUILD_MODNAME ": Failed to probe: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -640,8 +640,8 @@ static int adv7180_remove(struct i2c_client *client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_destroy(&state->mutex);
|
|
||||||
v4l2_device_unregister_subdev(sd);
|
v4l2_device_unregister_subdev(sd);
|
||||||
|
mutex_destroy(&state->mutex);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue