|
|
@@ -510,7 +510,12 @@ static const struct v4l2_ioctl_ops video_i2c_ioctl_ops = {
|
|
|
|
|
|
static void video_i2c_release(struct video_device *vdev)
|
|
|
{
|
|
|
- kfree(video_get_drvdata(vdev));
|
|
|
+ struct video_i2c_data *data = video_get_drvdata(vdev);
|
|
|
+
|
|
|
+ v4l2_device_unregister(&data->v4l2_dev);
|
|
|
+ mutex_destroy(&data->lock);
|
|
|
+ mutex_destroy(&data->queue_lock);
|
|
|
+ kfree(data);
|
|
|
}
|
|
|
|
|
|
static int video_i2c_probe(struct i2c_client *client,
|
|
|
@@ -608,10 +613,6 @@ static int video_i2c_remove(struct i2c_client *client)
|
|
|
struct video_i2c_data *data = i2c_get_clientdata(client);
|
|
|
|
|
|
video_unregister_device(&data->vdev);
|
|
|
- v4l2_device_unregister(&data->v4l2_dev);
|
|
|
-
|
|
|
- mutex_destroy(&data->lock);
|
|
|
- mutex_destroy(&data->queue_lock);
|
|
|
|
|
|
return 0;
|
|
|
}
|