diff options
Diffstat (limited to 'drivers/media/platform/mem2mem_testdev.c')
-rw-r--r-- | drivers/media/platform/mem2mem_testdev.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/media/platform/mem2mem_testdev.c b/drivers/media/platform/mem2mem_testdev.c index d03637537118..2e2121e98133 100644 --- a/drivers/media/platform/mem2mem_testdev.c +++ b/drivers/media/platform/mem2mem_testdev.c | |||
@@ -397,8 +397,7 @@ static void device_isr(unsigned long priv) | |||
397 | curr_ctx = v4l2_m2m_get_curr_priv(m2mtest_dev->m2m_dev); | 397 | curr_ctx = v4l2_m2m_get_curr_priv(m2mtest_dev->m2m_dev); |
398 | 398 | ||
399 | if (NULL == curr_ctx) { | 399 | if (NULL == curr_ctx) { |
400 | printk(KERN_ERR | 400 | pr_err("Instance released before the end of transaction\n"); |
401 | "Instance released before the end of transaction\n"); | ||
402 | return; | 401 | return; |
403 | } | 402 | } |
404 | 403 | ||
@@ -894,7 +893,7 @@ static int m2mtest_open(struct file *file) | |||
894 | 893 | ||
895 | if (mutex_lock_interruptible(&dev->dev_mutex)) | 894 | if (mutex_lock_interruptible(&dev->dev_mutex)) |
896 | return -ERESTARTSYS; | 895 | return -ERESTARTSYS; |
897 | ctx = kzalloc(sizeof *ctx, GFP_KERNEL); | 896 | ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); |
898 | if (!ctx) { | 897 | if (!ctx) { |
899 | rc = -ENOMEM; | 898 | rc = -ENOMEM; |
900 | goto open_unlock; | 899 | goto open_unlock; |
@@ -1020,7 +1019,7 @@ static int m2mtest_probe(struct platform_device *pdev) | |||
1020 | struct video_device *vfd; | 1019 | struct video_device *vfd; |
1021 | int ret; | 1020 | int ret; |
1022 | 1021 | ||
1023 | dev = kzalloc(sizeof *dev, GFP_KERNEL); | 1022 | dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); |
1024 | if (!dev) | 1023 | if (!dev) |
1025 | return -ENOMEM; | 1024 | return -ENOMEM; |
1026 | 1025 | ||
@@ -1028,7 +1027,7 @@ static int m2mtest_probe(struct platform_device *pdev) | |||
1028 | 1027 | ||
1029 | ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev); | 1028 | ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev); |
1030 | if (ret) | 1029 | if (ret) |
1031 | goto free_dev; | 1030 | return ret; |
1032 | 1031 | ||
1033 | atomic_set(&dev->num_inst, 0); | 1032 | atomic_set(&dev->num_inst, 0); |
1034 | mutex_init(&dev->dev_mutex); | 1033 | mutex_init(&dev->dev_mutex); |
@@ -1067,15 +1066,13 @@ static int m2mtest_probe(struct platform_device *pdev) | |||
1067 | 1066 | ||
1068 | return 0; | 1067 | return 0; |
1069 | 1068 | ||
1070 | v4l2_m2m_release(dev->m2m_dev); | ||
1071 | err_m2m: | 1069 | err_m2m: |
1070 | v4l2_m2m_release(dev->m2m_dev); | ||
1072 | video_unregister_device(dev->vfd); | 1071 | video_unregister_device(dev->vfd); |
1073 | rel_vdev: | 1072 | rel_vdev: |
1074 | video_device_release(vfd); | 1073 | video_device_release(vfd); |
1075 | unreg_dev: | 1074 | unreg_dev: |
1076 | v4l2_device_unregister(&dev->v4l2_dev); | 1075 | v4l2_device_unregister(&dev->v4l2_dev); |
1077 | free_dev: | ||
1078 | kfree(dev); | ||
1079 | 1076 | ||
1080 | return ret; | 1077 | return ret; |
1081 | } | 1078 | } |
@@ -1090,7 +1087,6 @@ static int m2mtest_remove(struct platform_device *pdev) | |||
1090 | del_timer_sync(&dev->timer); | 1087 | del_timer_sync(&dev->timer); |
1091 | video_unregister_device(dev->vfd); | 1088 | video_unregister_device(dev->vfd); |
1092 | v4l2_device_unregister(&dev->v4l2_dev); | 1089 | v4l2_device_unregister(&dev->v4l2_dev); |
1093 | kfree(dev); | ||
1094 | 1090 | ||
1095 | return 0; | 1091 | return 0; |
1096 | } | 1092 | } |