Re: [PATCH 11/15] media: intel/ipu6: input system video capture nodes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, 2023-07-27 at 15:15 +0800, bingbu.cao@xxxxxxxxx wrote:
> From: Bingbu Cao <bingbu.cao@xxxxxxxxx>
> 
> Register v4l2 video device and setup the vb2 queue to
> support basic video capture. Video streaming callback
> will trigger the input system driver to construct a
> input system stream configuration for firmware based on
> data type and stream ID and then queue buffers to firmware
> to do capture.
> 
> Signed-off-by: Bingbu Cao <bingbu.cao@xxxxxxxxx>
> ---

...

> +++ b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
...
> +void ipu6_isys_put_stream(struct ipu6_isys_stream *stream)
> +{
> +       struct device *dev = &stream->isys->adev->auxdev.dev;

stream can be NULL here (see below).

> +       unsigned int i;
> +       unsigned long flags;
> +
> +       if (!stream) {
> +               dev_err(dev, "no available stream\n");
> +               return;
> +       }

You can do

          dev = &stream->isys->adev->auxdev.dev;

here instead.

> +
> +       spin_lock_irqsave(&stream->isys->streams_lock, flags);
> +       for (i = 0; i < IPU6_ISYS_MAX_STREAMS; i++) {
> +               if (&stream->isys->streams[i] == stream) {
> +                       if (stream->isys->streams_ref_count[i] > 0)
> +                               stream->isys->streams_ref_count[i]--;
> +                       else
> +                               dev_warn(dev, "invalid stream %d\n",
> i);
> +
> +                       break;
> +               }
> +       }
> +       spin_unlock_irqrestore(&stream->isys->streams_lock, flags);
> +}

/Andreas




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux