Hi Mark,

On Wed, 24 Jul 2019 at 12:10, Mark Balantzyan <mbala...@gmail.com> wrote:
>

This commit needs to be thoroughly explained in order to make sense.

> Signed-off-by: Mark Balantzyan <mbala...@gmail.com>
> ---
> This patch adds a custom function to release video device in assignment to 
> vdev->release member in tw686x driver.
>
>  drivers/media/pci/tw686x/tw686x-video.c | 20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/pci/tw686x/tw686x-video.c 
> b/drivers/media/pci/tw686x/tw686x-video.c
> index 3a06c000..3631d0f5 100644
> --- a/drivers/media/pci/tw686x/tw686x-video.c
> +++ b/drivers/media/pci/tw686x/tw686x-video.c
> @@ -1151,6 +1151,21 @@ void tw686x_video_irq(struct tw686x_dev *dev, unsigned 
> long requests,
>         }
>  }
>
> +
> +
> +void tw686x_video_device_release(struct tw686x_video_channel *vc) {
> +       struct tw686x_dev *dev = vc->dev;
> +       unsigned int ch, pb;
> +
> +       for (ch = 0; ch < max_channels(dev); ch++) {
> +               struct tw686x_video_channel *vc = &dev->video_channels[ch];
> +
> +       dev->dma_ops->free;
> +

While I certainly appreciate your intention, you should at least test build
your patch.

You might want to read Documentation/process/ and get some insight on
upstreaming good practices.

Thanks,
Eze

> +       video_device_release((struct video_device*)dev);
> +
> +}
> +
>  void tw686x_video_free(struct tw686x_dev *dev)
>  {
>         unsigned int ch, pb;
> @@ -1160,9 +1175,6 @@ void tw686x_video_free(struct tw686x_dev *dev)
>
>                 video_unregister_device(vc->device);
>
> -               if (dev->dma_ops->free)
> -                       for (pb = 0; pb < 2; pb++)
> -                               dev->dma_ops->free(vc, pb);
>         }
>  }
>
> @@ -1277,7 +1289,7 @@ int tw686x_video_init(struct tw686x_dev *dev)
>                 snprintf(vdev->name, sizeof(vdev->name), "%s video", 
> dev->name);
>                 vdev->fops = &tw686x_video_fops;
>                 vdev->ioctl_ops = &tw686x_video_ioctl_ops;
> -               vdev->release = video_device_release;
> +               vdev->release = tw686x_video_device_release;
>                 vdev->v4l2_dev = &dev->v4l2_dev;
>                 vdev->queue = &vc->vidq;
>                 vdev->tvnorms = V4L2_STD_525_60 | V4L2_STD_625_50;
> --
> 2.17.1
>

Reply via email to