Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
[firefly-linux-kernel-4.4.55.git] / drivers / media / platform / timblogiw.c
index ccdadd623a3aae3ffabd49be553709d5a9511ec6..3cb2f3564873b7a4d03ebd8034eddd4563e42b4e 100644 (file)
@@ -347,7 +347,7 @@ static int timblogiw_s_std(struct file *file, void  *priv, v4l2_std_id std)
        mutex_lock(&lw->lock);
 
        if (TIMBLOGIW_HAS_DECODER(lw))
-               err = v4l2_subdev_call(lw->sd_enc, core, s_std, std);
+               err = v4l2_subdev_call(lw->sd_enc, video, s_std, std);
 
        if (!err)
                fh->cur_norm = timblogiw_get_norm(std);
@@ -800,7 +800,7 @@ static int timblogiw_probe(struct platform_device *pdev)
        if (!pdata->encoder.module_name)
                dev_info(&pdev->dev, "Running without decoder\n");
 
-       lw = kzalloc(sizeof(*lw), GFP_KERNEL);
+       lw = devm_kzalloc(&pdev->dev, sizeof(*lw), GFP_KERNEL);
        if (!lw) {
                err = -ENOMEM;
                goto err;
@@ -820,7 +820,7 @@ static int timblogiw_probe(struct platform_device *pdev)
        strlcpy(lw->v4l2_dev.name, DRIVER_NAME, sizeof(lw->v4l2_dev.name));
        err = v4l2_device_register(NULL, &lw->v4l2_dev);
        if (err)
-               goto err_register;
+               goto err;
 
        lw->video_dev.v4l2_dev = &lw->v4l2_dev;
 
@@ -837,8 +837,6 @@ static int timblogiw_probe(struct platform_device *pdev)
 
 err_request:
        v4l2_device_unregister(&lw->v4l2_dev);
-err_register:
-       kfree(lw);
 err:
        dev_err(&pdev->dev, "Failed to register: %d\n", err);
 
@@ -853,8 +851,6 @@ static int timblogiw_remove(struct platform_device *pdev)
 
        v4l2_device_unregister(&lw->v4l2_dev);
 
-       kfree(lw);
-
        return 0;
 }