media: atomisp: Drop atomisp_init_pipe()
authorHans de Goede <hdegoede@redhat.com>
Wed, 28 Dec 2022 21:48:15 +0000 (22:48 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Wed, 8 Feb 2023 07:03:07 +0000 (08:03 +0100)
commit20734fcae96c8e5fd164e7afe40088ffe4e71803
tree129e54db85b0eff25dfa6f417ae4808cceffac03
parent8972ed6ea7a00a39eab8f652e6f2f16a40ed2c3b
media: atomisp: Drop atomisp_init_pipe()

atomisp_init_pipe() does 3 things:

1. Init a bunch of list-heads / locks
2. Init the vb_queue for the videodev (aka pipe)
3. zero the per-frame parameters related variables of the pipe

1. and 2. really should not be done at file-open time, but once at probe.
Currently the code is getting away with doing this on every videodev-open
because only 1 open is allowed at a time.

1. is already done at probe time by atomisp_init_subdev_pipe(), move 2. to
atomisp_init_subdev_pipe() so that it is also done once at probe.

As for 3. The per-frame parameters can only be set from a qbuf ioctl,
which can only happen after a reqbufs ioctl and atomisp_buf_cleanup
already zeros the per-frame parameters when the buffers are released,
so 3. is not necessary at all.

Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_fops.c
drivers/staging/media/atomisp/pci/atomisp_fops.h
drivers/staging/media/atomisp/pci/atomisp_subdev.c