diff options
author | Hans de Goede <hdegoede@redhat.com> | 2023-05-11 18:33:06 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2023-06-09 14:43:16 +0100 |
commit | 0f072c1e2453e6c56b233b15a2f5d50606f02d85 (patch) | |
tree | 17d4d69894d5c44d22841ed6e3451fb455b80a6a /drivers/staging/media/atomisp/pci/atomisp_ioctl.c | |
parent | media: atomisp: Simplify atomisp_pipe_check() (diff) | |
download | wireguard-linux-0f072c1e2453e6c56b233b15a2f5d50606f02d85.tar.xz wireguard-linux-0f072c1e2453e6c56b233b15a2f5d50606f02d85.zip |
media: atomisp: Turn asd->streaming state tracker into a bool
The ATOMISP_DEVICE_STREAMING_STOPPING pipe state comes from when we still
had continuous mode. This would be set when streaming from both capture +
preview devnodes when 1 of the 2 streams has been stopped and the driver
was waiting for the other stream to get stopped too.
With continuous mode gone the stopping state is no longer necessary and
asd->streaming can be changed to a bool.
Note that atomisp_assert_recovery_work() would still temporarily
set streaming to stopping, but it does so with the isp->mutex held and
changes streaming to either enabled or disabled before releasing
the mutex, so none of the consumers which care about the difference
ever see the stopping state.
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/staging/media/atomisp/pci/atomisp_ioctl.c')
-rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c index 08a3d98794df..020d4184375f 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -601,7 +601,7 @@ static int atomisp_enum_input(struct file *file, void *fh, unsigned int atomisp_streaming_count(struct atomisp_device *isp) { - return isp->asd.streaming == ATOMISP_DEVICE_STREAMING_ENABLED; + return isp->asd.streaming; } /* @@ -1163,7 +1163,7 @@ int atomisp_start_streaming(struct vb2_queue *vq, unsigned int count) } spin_lock_irqsave(&isp->lock, irqflags); - asd->streaming = ATOMISP_DEVICE_STREAMING_ENABLED; + asd->streaming = true; spin_unlock_irqrestore(&isp->lock, irqflags); atomic_set(&asd->sof_count, -1); atomic_set(&asd->sequence, -1); @@ -1205,7 +1205,7 @@ int atomisp_start_streaming(struct vb2_queue *vq, unsigned int count) if (ret) { dev_err(isp->dev, "Starting sensor stream failed: %d\n", ret); spin_lock_irqsave(&isp->lock, irqflags); - asd->streaming = ATOMISP_DEVICE_STREAMING_DISABLED; + asd->streaming = false; spin_unlock_irqrestore(&isp->lock, irqflags); ret = -EINVAL; goto out_unlock; @@ -1246,7 +1246,7 @@ void atomisp_stop_streaming(struct vb2_queue *vq) dev_warn(isp->dev, "Warning timeout waiting for CSS to return buffers\n"); spin_lock_irqsave(&isp->lock, flags); - asd->streaming = ATOMISP_DEVICE_STREAMING_DISABLED; + asd->streaming = false; spin_unlock_irqrestore(&isp->lock, flags); atomisp_clear_css_buffer_counters(asd); |