Re: [PATCH 3/3] v4l: ioctl: Set bus_info in v4l_querycap()

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

 



On Mon, Jan 24, 2022 at 06:23:12PM +0200, Laurent Pinchart wrote:
> On Mon, Jan 24, 2022 at 06:02:59PM +0200, Sakari Ailus wrote:
> > Hi Laurent,
> > 
> > On Sun, Jan 23, 2022 at 01:51:10AM +0200, Laurent Pinchart wrote:
> > 
> > ...
> > 
> > > > diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> > > > index 642cb90f457c..81ebf6cca522 100644
> > > > --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> > > > +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> > > > @@ -18,6 +18,7 @@
> > > >  
> > > >  #include <linux/videodev2.h>
> > > >  
> > > > +#include <media/media-device.h> /* for media_set_bus_info() */
> > > >  #include <media/v4l2-common.h>
> > > >  #include <media/v4l2-ioctl.h>
> > > >  #include <media/v4l2-ctrls.h>
> > > > @@ -1069,6 +1070,8 @@ static int v4l_querycap(const struct v4l2_ioctl_ops *ops,
> > > >  	cap->capabilities |= V4L2_CAP_EXT_PIX_FORMAT;
> > > >  	cap->device_caps |= V4L2_CAP_EXT_PIX_FORMAT;
> > > >  
> > > > +	media_set_bus_info(cap->bus_info, vfd->dev_parent);
> > > > +
> > > 
> > > Shouldn't you do this before calling the driver operation, if you want
> > > to allow driver overrides ?
> > 
> > This is done conditionally based on the value of the first byte.
> 
> I had missed that.
> 
> Isn't it still better to call media_set_bus_info() first, instead of
> checking the first byte ?

The result would be no different although it's easier to see what's going
on. This approach would work for querycap but not for media device init.

I'll take this into account in v2.

-- 
Sakari Ailus



[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